Skip to content

Commit

Permalink
fix: tests for support experience
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Nov 22, 2024
1 parent 41444c3 commit 648450d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public void Serializes()
},
DependencyInstallCommand = "dotnet add package",
MaturityLevel = LanguageMaturityLevel.Preview,
SupportExperience = SupportExperience.Microsoft,
ClientClassName = "GraphServiceClient",
ClientNamespaceName = "Microsoft.Graph",
StructuredMimeTypes = new() {
Expand All @@ -43,7 +44,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\",\"type\":\"Bundle\"}],\"clientClassName\":\"GraphServiceClient\",\"clientNamespaceName\":\"Microsoft.Graph\",\"structuredMimeTypes\":[\"application/json\",\"application/xml\"]}}}", result);
Assert.Equal("{\"languagesInformation\":{\"CSharp\":{\"maturityLevel\":\"Preview\",\"supportExperience\":\"Microsoft\",\"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 @@ -61,6 +62,7 @@ public void Parses()
}},
{"dependencyInstallCommand", new OpenApiString("dotnet add package") },
{"maturityLevel", new OpenApiString("Preview")},
{"supportExperience", new OpenApiString("Microsoft")},
{"clientClassName", new OpenApiString("GraphServiceClient")},
{"clientNamespaceName", new OpenApiString("Microsoft.Graph")},
{"structuredMimeTypes", new OpenApiArray {
Expand All @@ -75,7 +77,8 @@ public void Parses()
Assert.NotNull(value);
Assert.True(value.LanguagesInformation.TryGetValue("CSharp", out var CSEntry));
Assert.Equal("dotnet add package", CSEntry.DependencyInstallCommand);
Assert.Equal(LanguageMaturityLevel.Experimental, CSEntry.MaturityLevel); //expected as we're not parsing the value from the description
Assert.Equal(LanguageMaturityLevel.Preview, CSEntry.MaturityLevel);
Assert.Equal(SupportExperience.Microsoft, CSEntry.SupportExperience);
Assert.Equal("GraphServiceClient", CSEntry.ClientClassName);
Assert.Equal("Microsoft.Graph", CSEntry.ClientNamespaceName);
Assert.Single(CSEntry.Dependencies);
Expand Down

0 comments on commit 648450d

Please sign in to comment.