public async Task PostDebitAsyncTest() { Mappers.MapperConfig.RegisterMappings(); DebitsController debitsController = new DebitsController(); var dtoDebit = CreateDTO(); var result = await debitsController.PostDebit(dtoDebit) as CreatedAtRouteNegotiatedContentResult <DTOs.Debit>; Assert.AreEqual(dtoDebit.CardId, result.Content.CardId); }
public async Task PostDebitBadRequestTest() { Mappers.MapperConfig.RegisterMappings(); DebitsController debitsController = new DebitsController(); var dtoDebit = new DTOs.Debit { CardId = "0", Code = "0", Value = 0M }; var result = await debitsController.PostDebit(dtoDebit) as BadRequestErrorMessageResult; Assert.AreEqual("Requisiçâo inválida.", result.Message); }