public void CreateInvalidTaxpayerwithnullSecondaryNameIntegrationTest()
        {
            restClient = new RestClient("https://*****:*****@yahoo.com",
                Language      = Domain.Enums.LanguageTypes.English
            };

            restRequest = new RestRequest(Method.POST);

            restRequest.AddJsonBody(command);

            restResponse = restClient.Execute(restRequest);
            Assert.That(restResponse.Content, Is.Not.Null);
            Assert.IsNotNull(restResponse.Content.Contains("Secondary Name"));
        }
        public void CreateValidTaxpayerIntegrationTest()
        {
            restClient = new RestClient("https://*****:*****@yahoo.com",
                Language      = Domain.Enums.LanguageTypes.English
            };

            restRequest.AddJsonBody(command);

            restResponse = restClient.Execute(restRequest);

            Assert.That(restResponse.Content, Is.Not.Null);
            JObject jObject = JObject.Parse(restResponse.Content);

            try
            {
                Domain.Models.Taxpayer taxpayer = jObject.ToObject <Domain.Models.Taxpayer>();
            }
            catch (Exception ex)
            {
                Assert.That(ex, Is.Not.Null);
            }
        }
Ejemplo n.º 3
0
 public async Task <IActionResult> Post([FromBody] TaxpayerCommand model)
 {
     try
     {
         return(await Response(_TaxpayerRepository.Add(new Taxpayer(model.CPF, model.Name, model.NumberDependents, model.GrossIncome)), ETipoResponse.Sucess));
     }
     catch (Exception e)
     {
         return(await Response(e.Message, ETipoResponse.Error));
     }
 }