예제 #1
0
        public async Task TestThatConfigLoadsFromStringWithFalse()
        {
            // Arrange
            var testJsonString =
                "{ \"delay\": 400, \"isEnabled\": false, \"error_code\": 404, \"exception_msg\": \"I really failed seriously\", \"rate\": 1 }";
            var policy = new LambdaChaosInjection.ChaosWrap <InjectDelay>(testJsonString);

            // Act
            var p = policy.CurrentPolicy;

            // Assert
            Assert.False(p.IsEnabled);
        }
예제 #2
0
        public async Task TestThatConfigLoadsFromString()
        {
            // Arrange
            var testJsonString =
                "{ \"delay\": 400, \"isEnabled\": true, \"error_code\": 404, \"exception_msg\": \"I really failed seriously\", \"rate\": 1 }";
            var policy = new LambdaChaosInjection.ChaosWrap <InjectDelay>(testJsonString);

            // Act
            var p = policy.CurrentPolicy;

            // Assert
            Assert.True(p.IsEnabled);
            Assert.Equal(404, p.ErrorCode);
            Assert.Equal("I really failed seriously", p.ExceptionMsg);
            Assert.Equal(1, p.Rate);
        }