[Test] public void MultipleStepsAreExecuted() { var instructions = new Instructions() .MakeVariable("variable", typeof (SampleClass)) .ExecuteMethod("samplemethod") .ExecuteMethod("samplemethod"); SampleClass.MethodCount = 0; instructions.Execute(); Assert.AreEqual(2, SampleClass.MethodCount); }
[Test] public void ExecutesMethodOnLibraryInstance() { var instructions = new Instructions() .MakeVariable("libraryvariable", typeof (SampleClass)) .MakeVariable("variable", typeof (DummyClass)) .ExecuteMethod("samplemethod"); SampleClass.MethodCount = 0; instructions.Execute(); Assert.AreEqual(1, SampleClass.MethodCount); }
[Test] public void StopTestExceptionSkipsRemainingSteps() { var instructions = new Instructions() .MakeVariable("variable", typeof (SampleClass)) .ExecuteMethod("samplemethod") .ExecuteAbortTest() .ExecuteMethod("samplemethod"); SampleClass.MethodCount = 0; instructions.Execute(); Assert.AreEqual(1, SampleClass.MethodCount); }
public void MultipleStepsAreExecuted() { var instructions = new Instructions() .MakeSampleClass() .ExecuteMethod("samplemethod") .ExecuteMethod("samplemethod"); SampleClass.MethodCount = 0; instructions.Execute(); Assert.AreEqual(2, SampleClass.MethodCount); }