public async Task Should_Success_ReadWithDateFilter_Data() { var dbContext = GetDbContext(GetCurrentMethod()); var serviceProviderMock = GetServiceProviderMock(); var service = new VbNonPORequestService(dbContext, serviceProviderMock.Object); var dataUtil = new VbNonPORequestDataUtil(service); await dataUtil.GetCreatedData(); var result = service.ReadWithDateFilter(DateTimeOffset.Now, 7, 1, 10, "{}", new List <string>(), "", "{}"); Assert.NotNull(result.Data); }
public async Task Should_Success_MapToViewModel() { var dbContext = GetDbContext(GetCurrentMethod()); var serviceProviderMock = GetServiceProviderMock(); var service = new VbNonPORequestService(dbContext, serviceProviderMock.Object); var dataUtil = new VbNonPORequestDataUtil(service); var data = await dataUtil.GetCreatedData(); var result = await service.ReadByIdAsync(data.Id); Assert.NotNull(result); }
public async Task Should_Success_Delete_ById() { var dbContext = GetDbContext(GetCurrentMethod()); var serviceProviderMock = GetServiceProviderMock(); var service = new VbNonPORequestService(dbContext, serviceProviderMock.Object); var dataUtil = new VbNonPORequestDataUtil(service); var data = await dataUtil.GetCreatedData(); var result = await service.DeleteAsync(data.Id); Assert.NotEqual(0, result); }
public async Task Should_Success_Update_Model_Remove_Items() { var dbContext = GetDbContext(GetCurrentMethod()); var serviceProviderMock = GetServiceProviderMock(); var service = new VbNonPORequestService(dbContext, serviceProviderMock.Object); var dataUtil = new VbNonPORequestDataUtil(service); var modelToUpdate = await dataUtil.GetCreatedData(); var viewmodelToCreate = dataUtil.GetViewModel(); var result = await service.UpdateAsync(modelToUpdate.Id, viewmodelToCreate); Assert.NotEqual(0, result); }