public async Task <DownPaymentModel> GetTestDataById()
        {
            DownPaymentModel model = GetNewData();
            await Service.CreateAsync(model);

            return(await Service.ReadByIdAsync(model.Id));
        }
Exemple #2
0
        public async Task Should_Success_Read_ById()
        {
            var dbContext           = GetDbContext(GetCurrentMethod());
            var serviceProviderMock = GetServiceProviderMock();
            var service             = new DownPaymentService(dbContext, serviceProviderMock.Object);
            var dataUtil            = new DownPaymentDataUtil(service);
            var data = await dataUtil.GetTestDataById();

            var result = await service.ReadByIdAsync(data.Id);

            Assert.NotNull(result);
        }
Exemple #3
0
        public async Task Should_Success_MapToViewModel()
        {
            var dbContext           = GetDbContext(GetCurrentMethod());
            var serviceProviderMock = GetServiceProviderMock();
            var service             = new DownPaymentService(dbContext, serviceProviderMock.Object);
            var dataUtil            = new DownPaymentDataUtil(service);
            var data = await dataUtil.GetTestDataById();

            var result = await service.ReadByIdAsync(data.Id);

            //Mapper.Initialize(mapper => mapper.AddProfile<DownPaymentProfile>());
            //Mapper.AssertConfigurationIsValid();
            //var viewModel = Mapper.Map<DownPaymentViewModel>(result);
            //Assert.NotNull(viewModel);
            //var model = Mapper.Map<DownPaymentModel>(viewModel);
            Assert.NotNull(result);
        }