public void StateMachineTest() { var stateMachine = new StateMachine(); stateMachine.SetStateA(1); DiskAssert.Matches(stateMachine, "Setup A"); stateMachine.SetStateB(2); DiskAssert.Matches(stateMachine, "Setup B"); var result = stateMachine.Sum(); DiskAssert.Matches(result, "Result"); }
public void RandomizerTest2() { // Test needs to run in parallel to RandomizerTest // Checks that Parallel test runs don't share randomizer seeds for (int i = 0; i < 10; i++) { var randomizedObject = new { String = PseudoRandom.String(), Int = PseudoRandom.Int(), DateTime = PseudoRandom.DateTime() }; DiskAssert.Matches(randomizedObject, $"RandomizedObj_{i}"); Thread.Sleep(1000); } }
public void SimpleTest() { DiskAssert.Matches(new { PropA = 1 }, "Step1"); }
public async Task AsyncTest() { await DiskAssert.Matches(Task.Run(() => new { PropA = 1 }), "Step1"); }
public void GuidTest() { DiskAssert.Matches(new PseudoRandomGuidProvider().NewGuid(), "Guid1"); DiskAssert.Matches(new PseudoRandomGuidProvider().NewGuid(), "Guid2"); DiskAssert.Matches(new PseudoRandomGuidProvider().NewGuid(), "Guid3"); }