Ejemplo n.º 1
0
        public async void CorrectlyHandlesADebugSessionWithoutDebugExceptions()
        {
            RulesControllerDiscipl controller = new RulesControllerDiscipl();
            var result = await controller.DebugRuleYamlContents(new OpenApi.v1.Features.discipl.Dto.DebugRuleYamlFromContentRequest()
            {
                Yaml = YamlTestFileLoader.Load(@"Zorgtoeslag5.yaml")
            });

            Assert.Equal(404, ((ObjectResult)result).StatusCode);
            Assert.Equal(ExecuteRuleYamlResultTypes.Ok,
                         ((Vs.Rules.OpenApi.v1.Features.discipl.Dto.DebugRuleYamlFromContentResponse)((ObjectResult)result).Value).ExecutionStatus);
        }
Ejemplo n.º 2
0
        public async void ShouldProvideDebugInformationUT()
        {
            RulesControllerDiscipl controller = new RulesControllerDiscipl();
            var result = await controller.DebugRuleYamlContents(new OpenApi.v1.Features.discipl.Dto.DebugRuleYamlFromContentRequest()
            {
                Yaml = YamlTestFileLoader.Load(@"Malformed/nl-NL/HeaderUnknownProperty.yaml")
            });

            var value = ((Vs.Rules.OpenApi.v1.Features.discipl.Dto.DebugRuleYamlFromContentResponse)((Microsoft.AspNetCore.Mvc.ObjectResult)result).Value);

            Assert.NotEmpty(value.ParseResult.FormattingExceptions);
            Assert.NotNull(value.ParseResult.FormattingExceptions[0].DebugInfo);
            Assert.NotNull(value.ParseResult.FormattingExceptions[0].Message);
        }