public async Task AllLogsShouldReturnCorrectResult() { // Arrange TestStartUp startUp = new TestStartUp(); TestStartUp.InitializeMapper(); var db = startUp.GetDbContext(); this.PopulateDb(db); var logService = new LogService(db); // Act var result = await logService.AllAsync(); // Assert result .Should() .Match(l => l.ElementAt(0).UserName == "user3" && l.ElementAt(1).UserName == "user2" && l.ElementAt(2).UserName == "user1") .And .HaveCount(3); }