December 2019
Intermediate to advanced
528 pages
11h 19m
English
It is always worth asking yourself this question. Tests are code, which means they take time to write and to maintain, so make sure they are earning their keep. Whether this test is doing that is actually debatable. What we are doing is creating a record and then retrieving that record. There is an amount of logic between those two steps, so the test is definitely testing something. Let's add a second test so that we can ensure that we don't retrieve records that aren't there:
[Fact] public async Task RetrieveInvalidRecord_DetailsCorrect() { // Arrange var testUrl = "www.pmichaels.net"; var options = new DbContextOptionsBuilder<ResearchContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()) .EnableSensitiveDataLogging() ...