Skip to content

Instantly share code, notes, and snippets.

@biac
Created March 20, 2012 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biac/2133554 to your computer and use it in GitHub Desktop.
Save biac/2133554 to your computer and use it in GitHub Desktop.
MSTest と NUnit のテストメソッドをひとつのテストクラスに押し込んでみたw #vs11 beta
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));
}
}
}
@biac
Copy link
Author

biac commented Mar 20, 2012

で、ユニットテストエクスプローラーで実行すると、いっぺんに両方とも走るw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment