Created
March 20, 2012 09:48
-
-
Save biac/2133554 to your computer and use it in GitHub Desktop.
MSTest と NUnit のテストメソッドをひとつのテストクラスに押し込んでみたw #vs11 beta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using FizzBuzzModel; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using NUnit.Framework; | |
using MS = Microsoft.VisualStudio.TestTools.UnitTesting; | |
using NU = NUnit.Framework; | |
namespace FizzBuzzModelTests | |
{ | |
// MSTest と NUnit のテストメソッドを、ひとつのテストクラスに収めることも可能 | |
// でも、こんなことをすると、おそらく後で分からなくなる | |
[TestClass] | |
[TestFixture()] | |
public class MSTestAndNUnit | |
{ | |
[TestMethod] | |
public void SayTest33_MSTest() | |
{ | |
MS.Assert.AreEqual<string>("Fizz", FizzBuzzLogic.Say(33)); | |
} | |
[TestCase(55, "Buzz")] | |
public void SayTest_NUnit(int n, string expected) | |
{ | |
NU.Assert.AreEqual(expected, FizzBuzzLogic.Say(n)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
で、ユニットテストエクスプローラーで実行すると、いっぺんに両方とも走るw