public async Task Given_AlreadyEvaluated_When_Dispose_Then_DependenciesNotDisposedTwice() { var result = await _sut.EvaluateAsync(); Assume.That(result != null); Assume.That(result.Completed); Assume.That(result.Met == true); TestDependenciesCleanUp(); _componentEvaluator.ResetCalls(); await _sut.DisposeAsync(); Assert.That(_componentEvaluator.DisposeCalled, Is.False); }
public async Task Given_Verified_When_Dispose_Then_DependenciesNotRedisposed() { var sut = new Verifier(new List <ExpectationEvaluator> { _expectation1, _expectation2 }); await sut.VerifyAsync(); Assume.That(_componentEvaluator1.DisposeCalled); Assume.That(_componentEvaluator2.DisposeCalled); _componentEvaluator1.ResetCalls(); _componentEvaluator2.ResetCalls(); await sut.DisposeAsync(); Assert.That(_componentEvaluator1.DisposeCalled, Is.False); Assert.That(_componentEvaluator2.DisposeCalled, Is.False); }