Example #1
0
        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);
        }
Example #2
0
        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);
        }