예제 #1
0
        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.ValidateStream(
                _resourceFacadeMock.Object,
                It.IsNotIn(StreamListenerState.Streaming),
                currentSequence);

            //
            //Assert
            //
            Assert.IsTrue(streamIsValid);
        }
예제 #2
0
        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.ValidateStream(
                _resourceFacadeMock.Object,
                StreamListenerState.Streaming,
                currentSequence);

            //
            //Assert
            //
            Assert.IsFalse(streamIsValid);
        }