本文介绍了什么是SUT和它是在哪里来的呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到很多人在谈论这个词SUT,但不明白为什么他们用这个词。



SUT就是要测试什么?



哪里这个词从何而来,什么意思呢?



例如在本次测试,什么是我的SUT?

  [TestMethod的] 
公共无效UsersAction_should_return_IndexAction()
{
常量长ID = 1;

UsersViewModel视图模型=新UsersViewModel()
{
SelectedUsers =新长[] {1,2,3,4}
};

的ActionResult结果= _controller.Users(ID,视图模型);

result.AssertActionRedirect()ToAction(「指数」)。
}


解决方案

被测系统(SUT )从单元测试的角度代表了所有的测试都没有嘲笑或存根演员(即一个或多个类)的。在你的榜样,这将是该控制器。


I see many people talking about the term SUT, but do not understand why they use that term.

SUT is what you want to test?

Where does this term come from and what does it mean?

For example in this test, what is my SUT?

[TestMethod]
public void UsersAction_should_return_IndexAction()
{
    const long id = 1;

    UsersViewModel viewModel = new UsersViewModel()
    {
        SelectedUsers = new long[] { 1, 2, 3, 4 }
    };

    ActionResult result = _controller.Users(id, viewModel);

    result.AssertActionRedirect().ToAction("Index");
}
解决方案

The System Under Test (SUT) from a Unit Testing perspective represents all of the actors (i.e one or more classes) in a test that are not mocks or stubs. In your example that would be the controller.

这篇关于什么是SUT和它是在哪里来的呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 08:48