Skip to content

Instantly share code, notes, and snippets.

@chomado
Created February 16, 2017 15:04
Show Gist options
  • Save chomado/9f211e8b3b04aaba05b450b3c59f1f37 to your computer and use it in GitHub Desktop.
Save chomado/9f211e8b3b04aaba05b450b3c59f1f37 to your computer and use it in GitHub Desktop.
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using LiveUnitTestSample;
namespace UnitTestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
// さっき作った Add 関数を呼んでいる
var answer = Calc.Add(2, 3);
// 期待される値と、実際の値を比較し、
// 一致したら「テスト成功」(ユニットテスト)
Assert.AreEqual(expected: 5, actual: answer);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment