public void ExtractorIsUsedToCalculateNewDelta(int old, int @new, int expected) { var input = PipelineTestHelper.Assignable(old); var sut = new LazyDeltaPipelineStage <int, int>("", Extractor, input); var test = sut.AttachTestStage(); input.SetValue(@new); test.AssertInvalidations(1); PipelineAssert.Value(sut, expected); }
public void InvalidationIsPropagatedWithoutAnyGetValueBeingCalled() { var assignable = PipelineTestHelper.Assignable(0); var test = assignable.AttachTestStage(); var sut = new LazyDeltaPipelineStage <int, int>("", Extractor, test); var sutTest = sut.AttachTestStage(); test.AssertInvalidationsAndRetrievals(0, 1); assignable.Invalidate(); test.AssertInvalidationsAndRetrievals(1, 1); sutTest.AssertInvalidationsAndRetrievals(1, 0); }