public async Task ExistsAsync_Should_Return_True_If_Exists_In_Database() { //Arrange var context = Context; IOfficeBusiness officeBusiness = new OfficeBusiness(context, _mapper, _cache, _busMock.Object); Office office = new Office { Id = Guid.NewGuid(), OpenTime = DateTime.Now.TimeOfDay, CloseTime = DateTime.Now.AddHours(1).TimeOfDay, Location = "Amsterdam" }; await context.Offices.AddAsync(office); await context.SaveChangesAsync(); //Act var exists = await officeBusiness.ExistsAsync(office.Id); //Assert Assert.True(exists); }
public async Task ExistsAsync_Should_Return_False_If_Not_Exists_In_Database() { //Arrange var context = Context; IOfficeBusiness officeBusiness = new OfficeBusiness(context, _mapper, _cache, _busMock.Object); //Act var exists = await officeBusiness.ExistsAsync(Guid.NewGuid()); //Assert Assert.False(exists); }