Ejemplo n.º 1
0
        public async Task Should_Success_Delete_Data()
        {
            var dbContext           = _dbContext(GetCurrentAsyncMethod());
            var serviceProviderMock = GetServiceProvider();

            serviceProviderMock
            .Setup(s => s.GetService(typeof(CoreDbContext)))
            .Returns(dbContext);

            var service = new AccountingCategoryService(serviceProviderMock.Object);
            var data    = await _dataUtil(service).GetTestData();

            var Response = await service.DeleteModel(data.Id);

            Assert.NotEqual(0, Response);
        }
Ejemplo n.º 2
0
        public void Should_Success_UploadData()
        {
            var dbContext           = _dbContext(GetCurrentAsyncMethod());
            var serviceProviderMock = GetServiceProvider();

            serviceProviderMock
            .Setup(s => s.GetService(typeof(CoreDbContext)))
            .Returns(dbContext);

            var service = new AccountingCategoryService(serviceProviderMock.Object);

            List <Lib.Models.AccountingCategory> data = new List <Lib.Models.AccountingCategory>();

            data.Add(new Lib.Models.AccountingCategory());

            var Response = service.UploadData(data);

            Assert.NotNull(Response);
        }
Ejemplo n.º 3
0
 public AccountingCategoryDataUtil(AccountingCategoryService service)
 {
     Service = service;
 }
Ejemplo n.º 4
0
 private AccountingCategoryDataUtil _dataUtil(AccountingCategoryService service)
 {
     return(new AccountingCategoryDataUtil(service));
 }