Web_Application/ASP.NET MVC UnitTest (2) 썸네일형 리스트형 [NSubstitute] HttpContext Mock // 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); C# Override Object Equals /*** * Excerpted from "Test Drive ASP.NET MVC", * published by The Pragmatic Bookshelf. * Copyrights apply to this code. It may not be used to create training material, * courses, books, articles, and the like. Contact us if you are in doubt. * We make no guarantees that this code is fit for any purpose. * Visit http://www.pragmaticprogrammer.com/titles/jmasp for more book information. ***/ usin.. 이전 1 다음