public async Task Should_Error_Create_Valid_Model() { var dbContext = GetDbContext(GetCurrentMethod()); var serviceProviderMock = GetServiceProviderMock(); var service = new AbsensiService(dbContext, serviceProviderMock.Object); var model = GetNewModel(); var result = await service.Create(model); await Assert.ThrowsAsync <Exception>(() => service.Delete(model.Id + 1)); }
public async Task Should_Success_Delete_Valid_Id() { var dbContext = GetDbContext(GetCurrentMethod()); var serviceProviderMock = GetServiceProviderMock(); var service = new AbsensiService(dbContext, serviceProviderMock.Object); var model = GetNewModel(); await service.Create(model); var result = await service.Delete(model.Id); Assert.NotEqual(result, 0); }