public void TestMethod1() { Form1 f1 = new Form1(); var fakeDevice = new TestBeeper(); f1.MachLaut(70, fakeDevice); Assert.AreEqual(2, fakeDevice.CallCount); }
public void MyTestMethod() { Form1 f1 = new Form1(); var fakeDevice = new TestBeeper(); Assert.ThrowsException <ArgumentException>(() => f1.MachLaut(49, fakeDevice)); Assert.ThrowsException <ArgumentException>(() => f1.MachLaut(50, fakeDevice)); f1.MachLaut(51, fakeDevice); }