public async Task When_AddingLog_Expect_LogAdded(int locationId, LocationActionEnum action) { _logService.AddLocationLog(locationId, action); await _dbContext.SaveChangesAsync(); var log = await _dbContext.Logs.FirstAsync(l => l.LocationId == locationId && l.Action == action); Assert.NotNull(log); }
public void AddLocationLog(int locationId, LocationActionEnum action) { var log = new Log { Date = GetDate(), LocationId = locationId, Action = action }; _dbContext.Logs.Add(log); }