public void AddTestSuccessTest() { using (var db = GetContext()) { var controller = new PersonController(db); var station = db.TestStations.First(); var person = db.Persons.First(); var countOld = db.Tests.Count(); var result = controller.AddTest(person.Id, new PersonController.TestterminDto { Station = station.StationName, TimeStamp = new DateTime(2021, 6, 1, 13, 0, 0) }) as NoContentResult; Assert.NotNull(result); Assert.True(db.Tests.Count() == countOld + 1); } }