public void SettingANewSourceCausesInvalidation() { var sut = new SourceSelectPipelineStage <string>("", "".AsPipelineConstant()); var test = sut.AttachTestStage(); Assert.IsTrue(sut.SetSource("Derpface".AsPipelineConstant())); test.AssertInvalidations(1); }
public void SettingTheCurrentSourceAsNewSourceCausesNoInvalidation() { var source = 3.AsPipelineConstant(); var sut = new SourceSelectPipelineStage <int>("", source); var test = sut.AttachTestStage(); Assert.IsFalse(sut.SetSource(source)); test.AssertInvalidations(0); }
public void ValueIsTakenFromCurrentSource() { var sut = new SourceSelectPipelineStage <string>("", "Hello, World?".AsPipelineConstant()); PipelineAssert.Value(sut, "Hello, World?"); sut.SetSource("Whazzup?".AsPipelineConstant()); PipelineAssert.Value(sut, "Whazzup?"); sut.SetSourceWithoutInvalidating("Yo!".AsPipelineConstant()); PipelineAssert.Value(sut, "Yo!"); }
public void SettingANewSourceRemovesOldDependencyANdAddsNew() { var input = 1.AsPipelineConstant(); var sut = new SourceSelectPipelineStage <int>("", input); PipelineAssert.DependentOn(sut, input); var input2 = 2.AsPipelineConstant(); sut.SetSource(input2); PipelineAssert.NotDependentOn(sut, input); PipelineAssert.DependentOn(sut, input2); var input3 = 3.AsPipelineConstant(); sut.SetSourceWithoutInvalidating(input3); PipelineAssert.NotDependentOn(sut, input2); PipelineAssert.DependentOn(sut, input3); }