private static async Task CheckRootTag3(StarryNightDbContext context, TagDto rootDto3) { Tag root3Tag = await context.Tags.Include(t => t.Children) .ThenInclude(t => t.Children).FirstOrDefaultAsync(t => t.Id == rootDto3.Id); root3Tag.Name.ShouldBe("Root3"); root3Tag.Children.Count.ShouldBe(0); }
public static void SeedHostDb(StarryNightDbContext context) { context.SuppressAutoSetTenantId = true; // Host seed new InitialHostDbBuilder(context).Create(); // Default tenant seed (in host database). new DefaultTenantBuilder(context).Create(); new TenantRoleAndUserBuilder(context, 1).Create(); }
private static async Task CheckRootTag2(StarryNightDbContext context, TagDto rootDto2) { Tag root2Tag = await context.Tags.Include(t => t.Children) .ThenInclude(t => t.Children).FirstOrDefaultAsync(t => t.Id == rootDto2.Id); root2Tag.Name.ShouldBe("Root2"); root2Tag.Children.Count.ShouldBe(1); Tag sub21Tag = root2Tag.Children.ToList()[0]; sub21Tag.Name.ShouldBe("Sub21"); sub21Tag.Children.Count.ShouldBe(1); Tag leaf211 = sub21Tag.Children.ToList()[0]; leaf211.Name.ShouldBe("Leaf211"); leaf211.Children.Count.ShouldBe(0); }
private static async Task CheckRootTag1(StarryNightDbContext context, TagDto rootDto1) { Tag root1Tag = await context.Tags.Include(t => t.Children) .ThenInclude(t => t.Children).FirstOrDefaultAsync(t => t.Id == rootDto1.Id); root1Tag.Name.ShouldBe("Root1"); root1Tag.Children.Count.ShouldBe(2); Tag sub11Tag = root1Tag.Children.ToList()[0]; sub11Tag.Name.ShouldBe("Sub11"); sub11Tag.Children.Count.ShouldBe(2); Tag leaf111 = sub11Tag.Children.ToList()[0]; leaf111.Name.ShouldBe("Leaf111"); leaf111.Children.Count.ShouldBe(0); Tag leaf112 = sub11Tag.Children.ToList()[1]; leaf112.Name.ShouldBe("Leaf112"); leaf112.Children.Count.ShouldBe(0); Tag sub12Tag = root1Tag.Children.ToList()[1]; sub12Tag.Name.ShouldBe("Sub12"); sub12Tag.Children.Count.ShouldBe(2); Tag leaf121 = sub12Tag.Children.ToList()[0]; leaf121.Name.ShouldBe("Leaf111"); leaf121.Children.Count.ShouldBe(0); Tag leaf122 = sub12Tag.Children.ToList()[1]; leaf122.Name.ShouldBe("Leaf112"); leaf122.Children.Count.ShouldBe(0); }
public DefaultSettingsCreator(StarryNightDbContext context) { _context = context; }
public DefaultLanguagesCreator(StarryNightDbContext context) { _context = context; }
public TenantRoleAndUserBuilder(StarryNightDbContext context, int tenantId) { _context = context; _tenantId = tenantId; }
public DefaultTenantBuilder(StarryNightDbContext context) { _context = context; }
public HostRoleAndUserCreator(StarryNightDbContext context) { _context = context; }
public InitialHostDbBuilder(StarryNightDbContext context) { _context = context; }
public DefaultEditionCreator(StarryNightDbContext context) { _context = context; }