Beispiel #1
0
        public async Task DeveNegarCadastro()
        {
            //given
            var provider = this.BuildServiceProvider();
            var settings = provider.GetRequiredService <DecisionMachineSettings>();
            var desicionMachineService = provider.GetRequiredService <IDesicionMachineService>();

            ExecutarPodeCadastrarModel data = new ExecutarPodeCadastrarModel();

            data.Documento = "062.348.835-32";
            data.Idade     = 48;

            data.SeedClientes();

            //when
            var response = await desicionMachineService.PostAsync <ExecutarPodeCadastrarModel>(data, settings.Rules.Pode_Cadastrar_Url);

            //then
            desicionMachineService.Should().NotBeNull();
            response.Should().NotBeNull();
            response.Should().BeOfType <PodeCadastrarRegra>();
            response.DecisionId.Should().NotBeEmpty();
            response.Pode_Cadastrar.Should().NotBeNull();
            response.Pode_Cadastrar.Sucesso.Should().BeFalse();
            response.Pode_Cadastrar.Mensagens.Any().Should().BeTrue();
            response.Pode_Cadastrar.Mensagens.Any(m => m.ToLower().Contains("não")).Should().BeTrue();
        }
Beispiel #2
0
        public async Task DeveExecutarComandoPostAsync()
        {
            //given
            var provider = this.BuildServiceProvider();
            var settings = provider.GetRequiredService <DecisionMachineSettings>();
            var desicionMachineService = provider.GetRequiredService <IDesicionMachineService>();

            var data = new ExecutarPodeCadastrarModel();

            data.Documento = "604.926.888-69";
            data.Idade     = 50;

            data.SeedClientes();

            //when
            var response = await desicionMachineService.PostAsync <ExecutarPodeCadastrarModel>(data, settings.Rules.Pode_Cadastrar_Url);

            //then
            desicionMachineService.Should().NotBeNull();
            response.Should().NotBeNull();
            response.Should().BeOfType <PodeCadastrarRegra>();
        }