// arrange var contextMock = Substitute.For(); var requestMock = Substitute.For (); var queryString = new NameValueCollection(); queryString["foo"] = "bar"; requestMock.QueryString.Returns(queryString); contextMock.Request.Returns(requestMock); var sut = new SomeController(); sut.ControllerContext = new ControllerContext(contextMock, new RouteData(), sut);
'Web_Application > ASP.NET MVC UnitTest' 카테고리의 다른 글
C# Override Object Equals (0) | 2016.08.29 |
---|