Пример #1
0
        public async Task TestGetClientsByIdAsync()
        {
            var dbContext  = DbContextMock.GetDbContext(nameof(TestGetClientsByIdAsync));
            var controller = new ClientController(dbContext);

            var response = await controller.GetClientByIdAsync(1) as ObjectResult;

            var value = response.Value as ISingleResponse <Client>;

            Assert.False(value.DidError);
        }
Пример #2
0
        public async Task TestPostClientAsync()
        {
            var dbContext  = DbContextMock.GetDbContext(nameof(TestPostClientAsync));
            var controller = new ClientController(dbContext);

            var client = new Client
            {
                Id    = 0,
                Name  = "Mi cliente nuevo de prueba",
                Nit   = "8002949-8",
                Email = "*****@*****.**",
            };

            var response = await controller.PostClientAsync(client) as ObjectResult;

            var value = response.Value as ISingleResponse <Client>;

            Assert.False(value.DidError);
        }