public void GivenFixtureWhenNotStreamingThenValidateStreamReturnsTrue() { // //Arrange // var resourceSummary = new Summary { Sequence = 5 }; _resourceFacadeMock.SetupGet(o => o.Content).Returns(resourceSummary); int currentSequence = 1; _settings.SetupGet(s => s.StreamSafetyThreshold).Returns(3); var streamHealthCheckValidation = new StreamHealthCheckValidation(_settings.Object); // //Act // bool streamIsValid = streamHealthCheckValidation.IsSequenceValid( _resourceFacadeMock.Object, It.IsNotIn(StreamListenerState.Streaming), currentSequence); // //Assert // Assert.IsTrue(streamIsValid); }
public void GivenFixtureWhenInSetupAndStreamingThenValidateStreamReturnsFalse() { // //Arrange // var resourceSummary = new Summary { Sequence = 5, MatchStatus = (int)MatchStatus.Setup }; _resourceFacadeMock.SetupGet(o => o.Content).Returns(resourceSummary); int currentSequence = 1; _settings.SetupGet(s => s.StreamSafetyThreshold).Returns(3); _settings.SetupGet(s => s.AllowFixtureStreamingInSetupMode).Returns(true); var streamHealthCheckValidation = new StreamHealthCheckValidation(_settings.Object); // //Act // bool streamIsValid = streamHealthCheckValidation.IsSequenceValid( _resourceFacadeMock.Object, StreamListenerState.Streaming, currentSequence); // //Assert // Assert.IsFalse(streamIsValid); }