public async Task IModelBuilder_LogChildren(string projectPath) { var modelBuilder = await RestierTestHelpers.GetTestableInjectedService <LibraryApi, LibraryContext, IModelBuilder>(); var result = GetModelBuilderChildren(modelBuilder); var fullPath = Path.Combine(projectPath, "..//Microsoft.Restier.Tests.AspNet//Baselines//RC2-ModelBuilder-InnerHandlers.txt"); Console.WriteLine(fullPath); if (!Directory.Exists(Path.GetDirectoryName(fullPath))) { Directory.CreateDirectory(Path.GetDirectoryName(fullPath)); } File.WriteAllText(fullPath, string.Join(Environment.NewLine, result)); Console.WriteLine($"File exists: {File.Exists(fullPath)}"); }
public async Task RestierRC2_VerifyModelBuilderInnerHandlers() { var modelBuilder = await RestierTestHelpers.GetTestableInjectedService <LibraryApi, LibraryContext, IModelBuilder>(); modelBuilder.Should().NotBeNull(); var children = GetModelBuilderChildren(modelBuilder); children.Should().NotBeNullOrEmpty(); var result = string.Join(Environment.NewLine, children); result.Should().NotBeNullOrWhiteSpace(); var baseline = File.ReadAllText("..//..//..//..//Microsoft.Restier.Tests.AspNet//Baselines/RC2-ModelBuilder-InnerHandlers.txt"); result.Should().Be(baseline); }