public async Task GetAllRootTags_Test() { await CreateTagTree1(); await CreateTagTree2(); await CreateTagTree3(); var output = await tagAppService.GetAllRootTags(); output.Count.ShouldBe(3); IList <TagDto> tagDtos = output.ToList(); TagDto rootDto1 = tagDtos[0]; TagDto rootDto2 = tagDtos[1]; TagDto rootDto3 = tagDtos[2]; // Unit test project does not support lazy loading. // Navigation properties need eager loading. await UsingDbContextAsync(async context => { await CheckRootTag1(context, rootDto1); await CheckRootTag2(context, rootDto2); await CheckRootTag3(context, rootDto3); }); }