예제 #1
0
        public async Task Should_Success_Upload_Data()
        {
            COAService service = new COAService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            COAModel   model   = _dataUtil(service).GetNewData();

            List <COAModel> coa = new List <COAModel>()
            {
                model
            };

            await service.UploadData(coa);

            Assert.True(true);
        }
예제 #2
0
        public async Task Should_Fail_Upload_Existed_Data()
        {
            COAService   service   = new COAService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            COAViewModel viewModel = _dataUtil(service).GetNewViewModel();

            List <COAViewModel> coa = new List <COAViewModel>()
            {
                viewModel
            };
            COAModel model = _dataUtil(service).GetNewData();

            List <COAModel> coaModel = new List <COAModel>()
            {
                model
            };
            await service.UploadData(coaModel);

            var Response2 = service.UploadValidate(ref coa, null);

            Assert.False(Response2.Item1);
        }