Exemplo n.º 1
0
        public async Task <COAModel> GetTestData()
        {
            COAModel model = GetNewData();
            await Service.CreateAsync(model);

            return(await Service.ReadByIdAsync(model.Id));
        }
Exemplo n.º 2
0
        public async Task Should_Success_Create_Data()
        {
            COAService service  = new COAService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            COAModel   model    = _dataUtil(service).GetNewData();
            var        Response = await service.CreateAsync(model);

            Assert.NotEqual(0, Response);
        }
Exemplo n.º 3
0
        public async Task Should_Success_Get_Empty_Name_Coa()
        {
            COAService service = new COAService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            COAModel   model   = _dataUtil(service).GetNewData();

            model.Name = null;
            await service.CreateAsync(model);

            var reportResponse = await service.GetEmptyNames();

            Assert.NotEmpty(reportResponse);
        }
Exemplo n.º 4
0
        public async Task Should_Success_Revise_Empty_Name_Coa_But_Empty_List()
        {
            COAService service = new COAService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            COAModel   model   = _dataUtil(service).GetNewData();
            await service.CreateAsync(model);

            var createdModel = await service.ReadByIdAsync(model.Id);

            createdModel.Name = null;
            List <COAModel> models = new List <COAModel>()
            {
                createdModel
            };

            var reportResponse = await service.ReviseEmptyNamesCoa(models);

            Assert.NotEqual(0, reportResponse);
        }