Пример #1
0
        public void Should_Set_Times_Limited(int times)
        {
            // Arrange
            var builder = new FluentExpectationBuilder();

            // Act
            var result = builder.RespondTimes(times, 200).Setup().Expectations.First().AsJson();

            // Assert
            _outputHelper.WriteLine(result);
            result
            .Should()
            .MatchRegex($@"(?m)\s*""times"":\s*\{{\s*""remainingTimes"":\s*{times},\s*""unlimited"":\s*false\s*}}");
        }
Пример #2
0
        public void Should_Set_Times_Always()
        {
            // Arrange
            var builder = new FluentExpectationBuilder();
            var setup   = builder
                          .RespondTimes(() => Times.Always, 200)
                          .Setup();

            // Act
            var result = setup.Expectations.First().AsJson();

            // Assert
            _outputHelper.WriteLine(result);
            result
            .Should()
            .MatchRegex($@"(?m)\s*""times"":\s*\{{\s*""remainingTimes"":\s*0,\s*""unlimited"":\s*true\s*}}");
        }