public void ShouldSendTheResultToAnyListeners() { var testSubject = new PipeSource <decimal, decimal>(_AddThree); using (var monitor = testSubject.Monitor()) { testSubject.Call(4); var expectation = new[] { Result(7), Done() }; monitor.OccurredEvents.Should() .BeEquivalentTo(expectation, options => options.WithStrictOrdering() .ExcludingMissingMembers()); } }
public void ShouldAllowGeneratorFunctionsToPushSeveralArgumentsThenAutomaticallyFinishWhenTheyAreDone() { var testSubject = new PipeSource <decimal, decimal>(_AddOneTwoThree); using (var monitor = testSubject.Monitor()) { testSubject.Call(4); var expectation = new[] { Result(5), Result(6), Result(7), Done() }; monitor.OccurredEvents.Should() .BeEquivalentTo(expectation, options => options.WithStrictOrdering() .ExcludingMissingMembers()); } }