public void WhenProcessingInput_Then_Output_EqualsInput() { const double input = 3d; var sut = new IdentityIndicator(); sut.Process(input); Assert.AreEqual(input, sut.Output); }
public void WhenChainingIndicatorsUsingOf_Then_FirstIndicatorOutput_IsForwarded_ToSecondIndicatorInput() { var first = new IdentityIndicator(); var second = new IdentityIndicator(); second.Of(first, true); first.Process(1); Assert.AreEqual(1, second.Output); }
public void WhenProcessingInput_Then_OutputUpdated_IsRaised() { var sut = new IdentityIndicator(); var output = 0d; sut.OutputUpdated += (sender, o) => output = o; sut.Process(1); Assert.AreEqual(1, output); }
public void WhenProcessingDataByLeftOrRightIndicator_Then_OutputUpdated_IsRaised() { var left = new IdentityIndicator(); var right = new IdentityIndicator(); var sut = new CompositeIndicator(left, right, (l, r) => l.Output + r.Output); var output = 0d; sut.OutputUpdated += (sender, o) => output = o; left.Process(1); Assert.AreEqual(1, output); right.Process(2); Assert.AreEqual(3, output); }
public void WhenConstructingNewInstance_Then_IsReady_IsFalse() { var sut = new IdentityIndicator(); Assert.IsFalse(sut.IsReady); }
public void WhenConstructingNewInstance_Then_Output_IsZero() { var sut = new IdentityIndicator(); Assert.AreEqual(0, sut.Output); }