Skip to content

Commit

Permalink
chore: updates parsing and serialization unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Sep 11, 2024
1 parent 4c9f51b commit bea4e59
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public void Serializes()
new LanguageDependency {
Name = "Microsoft.Graph.Core",
Version = "1.0.0",
DependencyType = DependencyType.Bundle,
}
},
DependencyInstallCommand = "dotnet add package",
Expand All @@ -42,7 +43,7 @@ public void Serializes()

value.Write(writer, OpenApiSpecVersion.OpenApi3_0);
var result = sWriter.ToString();
Assert.Equal("{\"languagesInformation\":{\"CSharp\":{\"maturityLevel\":\"Preview\",\"dependencyInstallCommand\":\"dotnet add package\",\"dependencies\":[{\"name\":\"Microsoft.Graph.Core\",\"version\":\"1.0.0\"}],\"clientClassName\":\"GraphServiceClient\",\"clientNamespaceName\":\"Microsoft.Graph\",\"structuredMimeTypes\":[\"application/json\",\"application/xml\"]}}}", result);
Assert.Equal("{\"languagesInformation\":{\"CSharp\":{\"maturityLevel\":\"Preview\",\"dependencyInstallCommand\":\"dotnet add package\",\"dependencies\":[{\"name\":\"Microsoft.Graph.Core\",\"version\":\"1.0.0\",\"type\":\"Bundle\"}],\"clientClassName\":\"GraphServiceClient\",\"clientNamespaceName\":\"Microsoft.Graph\",\"structuredMimeTypes\":[\"application/json\",\"application/xml\"]}}}", result);
}
[Fact]
public void Parses()
Expand All @@ -55,6 +56,7 @@ public void Parses()
new OpenApiObject {
{"name", new OpenApiString("Microsoft.Graph.Core")},
{"version", new OpenApiString("1.0.0") },
{"type", new OpenApiString("bundle")}
}
}},
{"dependencyInstallCommand", new OpenApiString("dotnet add package") },
Expand Down Expand Up @@ -82,5 +84,6 @@ public void Parses()
Assert.Contains("application/json", CSEntry.StructuredMimeTypes);
Assert.Contains("application/xml", CSEntry.StructuredMimeTypes);
Assert.Equal("1.0.0", CSEntry.Dependencies[0].Version);
Assert.Equal(DependencyType.Bundle, CSEntry.Dependencies[0].DependencyType);
}
}

0 comments on commit bea4e59

Please sign in to comment.