Created
February 16, 2017 15:58
-
-
Save chomado/a0dfa5a87e27c60f7815c9bc66f35e6a to your computer and use it in GitHub Desktop.
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 System; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using LiveUnitTestSample; | |
namespace UnitTestProject1 | |
{ | |
[TestClass] | |
public class UnitTest1 | |
{ | |
[TestMethod] | |
public void TestMethod1() | |
{ | |
var answer = Calc.Add(2, 3); | |
// 期待される値と、実際の値を比較し、 | |
// 一致したら「テスト成功」(ユニットテスト) | |
Assert.AreEqual(expected: 5, actual: answer); | |
} | |
// ----- ここから追加分 ------------------- | |
// tips: "tesm" でテストメソッドのスニペット (tab+tab) | |
[TestMethod] | |
public void AddTest() | |
{ | |
var answer = Calc.Add(4, 5); | |
// 期待される値と、実際の値を比較し、 | |
// 一致したら「テスト成功」(ユニットテスト) | |
Assert.AreEqual(expected: 9, actual: answer); | |
} | |
// ----- ここまで追加分 ------------------- | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment