Пример #1
0
        public void InitialBaselineValueIsUsedInInitialDeltaEvaluation(int initial)
        {
            var assignable = PipelineTestHelper.Assignable(initial);
            var sut        = new LazyDeltaPipelineStage <int, int>("", Extractor, assignable);

            PipelineAssert.Value(sut, 0);
        }
Пример #2
0
        public void InvalidationOfInputsInvalidatesStage()
        {
            var a    = PipelineTestHelper.Assignable(1);
            var sut  = new CollectingPipelineStage <int>("", new[] { a });
            var test = sut.AttachTestStage();

            a.Invalidate();
            test.AssertInvalidations(1);
        }
Пример #3
0
        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);
        }
Пример #4
0
        public void InvalidationOfRemovedInputDoesNotInvalidateTheStage()
        {
            var a   = PipelineTestHelper.Assignable(1);
            var sut = new CollectingPipelineStage <int>("", new[] { a });

            sut.RemoveDependencies(new[] { a });
            var test = sut.AttachTestStage();

            a.Invalidate();
            test.AssertInvalidations(0);
        }
Пример #5
0
        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);
        }