Yanor.net/
Wiki
Blog
GitHub
Sandbox
開始行:
* 単体テスト [#td9f946e]
** テストプロジェクトの作成 [#h36dbf5e]
** テストコード [#xf4ae845]
using Microsoft.VisualStudio.TestTools.UnitTesting;
using WebApplication1;
using WebApplication1.Controllers;
namespace WebApplication1.Tests.Controllers
{
[TestClass]
public class HomeControllerTest
{
[TestMethod]
public void Index()
{
// Arrange
HomeController controller = new HomeControll...
// Act
ViewResult result = controller.Index() as Vi...
// Assert
Assert.IsNotNull(result);
}
}
}
** コントローラーのテスト [#n41f42f8]
*** 参考 [#t2e4e710]
http://stackoverflow.com/questions/8562888/unit-testing-m...
** 参考 [#p82732e8]
- http://code.msdn.microsoft.com/10-ASPNET-MVC-C-b532db60
終了行:
* 単体テスト [#td9f946e]
** テストプロジェクトの作成 [#h36dbf5e]
** テストコード [#xf4ae845]
using Microsoft.VisualStudio.TestTools.UnitTesting;
using WebApplication1;
using WebApplication1.Controllers;
namespace WebApplication1.Tests.Controllers
{
[TestClass]
public class HomeControllerTest
{
[TestMethod]
public void Index()
{
// Arrange
HomeController controller = new HomeControll...
// Act
ViewResult result = controller.Index() as Vi...
// Assert
Assert.IsNotNull(result);
}
}
}
** コントローラーのテスト [#n41f42f8]
*** 参考 [#t2e4e710]
http://stackoverflow.com/questions/8562888/unit-testing-m...
** 参考 [#p82732e8]
- http://code.msdn.microsoft.com/10-ASPNET-MVC-C-b532db60
ページ名: