Skip to content

Commit

Permalink
Merge pull request #5064 from microsoft/dependabot/nuget/xunit-2.9.0
Browse files Browse the repository at this point in the history
chore(deps): bump xunit from 2.7.0 to 2.9.0
  • Loading branch information
github-actions[bot] authored Aug 1, 2024
2 parents a45fed7 + cbc7f9c commit 4d3866a
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.SDK" Version="17.10.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
2 changes: 1 addition & 1 deletion tests/Kiota.Builder.Tests/CodeDOM/CodeBlockTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public void ReplacesImplementsByName()
IsExternal = true
});
model.StartBlock.ReplaceImplementByName("IParsable", "Parsable");
Assert.Empty(model.StartBlock.Implements.Where(x => x.Name == "IParsable"));
Assert.DoesNotContain(model.StartBlock.Implements, x => x.Name == "IParsable");
Assert.Single(model.StartBlock.Implements.Where(x => x.Name == "Parsable"));
}
}
2 changes: 1 addition & 1 deletion tests/Kiota.Builder.Tests/Kiota.Builder.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageReference Include="DotNet.Glob" Version="3.1.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="moq" Version="4.20.70" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
24 changes: 12 additions & 12 deletions tests/Kiota.Builder.Tests/KiotaBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2667,8 +2667,8 @@ public void DoesntAddPropertyHolderOnNonAdditionalModels()
var codeModel = builder.CreateSourceModel(node);
var weatherType = codeModel.FindChildByName<CodeClass>("WeatherForecast");
Assert.NotNull(weatherType);
Assert.Empty(weatherType.StartBlock.Implements.Where(x => x.Name.Equals("IAdditionalDataHolder", StringComparison.OrdinalIgnoreCase)));
Assert.Empty(weatherType.Properties.Where(x => x.IsOfKind(CodePropertyKind.AdditionalData)));
Assert.DoesNotContain(weatherType.StartBlock.Implements, x => x.Name.Equals("IAdditionalDataHolder", StringComparison.OrdinalIgnoreCase));
Assert.DoesNotContain(weatherType.Properties, x => x.IsOfKind(CodePropertyKind.AdditionalData));
}
[Fact]
public void SquishesLonelyNullables()
Expand Down Expand Up @@ -6231,7 +6231,7 @@ public void SupportsIncludeFilterWithOperation()
Assert.NotNull(messagesRS);
Assert.Single(messagesRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Post));
Assert.Single(messagesRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Get));
Assert.Empty(messagesRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Put));
Assert.DoesNotContain(messagesRS.Methods, static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Put);
var studentsNS = codeModel.FindNamespaceByName("TestSdk.students");
var studentsRS = studentsNS.FindChildByName<CodeClass>("StudentsRequestBuilder");
Assert.NotNull(studentsRS);
Expand Down Expand Up @@ -8010,10 +8010,10 @@ public async Task InheritanceWithAllOfWith3Parts3SchemaParentClass()
Assert.NotNull(groupClass);
Assert.Single(groupClass.Properties);
Assert.NotNull(groupClass.StartBlock.Inherits);
Assert.Empty(groupClass.Properties.Where(static x => x.Kind is CodePropertyKind.AdditionalData));
Assert.Empty(groupClass.Properties.Where(static x => x.Name.Equals("oDataType", StringComparison.OrdinalIgnoreCase)));
Assert.Empty(groupClass.Properties.Where(static x => x.Name.Equals("facetprop1", StringComparison.OrdinalIgnoreCase)));
Assert.Empty(groupClass.Properties.Where(static x => x.Name.Equals("facetprop2", StringComparison.OrdinalIgnoreCase)));
Assert.DoesNotContain(groupClass.Properties, static x => x.Kind is CodePropertyKind.AdditionalData);
Assert.DoesNotContain(groupClass.Properties, static x => x.Name.Equals("oDataType", StringComparison.OrdinalIgnoreCase));
Assert.DoesNotContain(groupClass.Properties, static x => x.Name.Equals("facetprop1", StringComparison.OrdinalIgnoreCase));
Assert.DoesNotContain(groupClass.Properties, static x => x.Name.Equals("facetprop2", StringComparison.OrdinalIgnoreCase));
Assert.Single(groupClass.Properties.Where(static x => x.Name.Equals("groupprop1", StringComparison.OrdinalIgnoreCase)));
}
[Fact]
Expand Down Expand Up @@ -8168,7 +8168,7 @@ public async Task InheritanceWithAllOfWith3Parts1Schema2Inline(bool reverseOrder
Assert.NotNull(resultClass);
Assert.Equal("directoryObject", resultClass.StartBlock.Inherits?.Name, StringComparer.OrdinalIgnoreCase);
Assert.Equal(2, resultClass.Properties.Count());
Assert.Empty(resultClass.Properties.Where(static x => x.Name.Equals("oDataType", StringComparison.OrdinalIgnoreCase)));
Assert.DoesNotContain(resultClass.Properties, static x => x.Name.Equals("oDataType", StringComparison.OrdinalIgnoreCase));
Assert.Single(resultClass.Properties.Where(static x => x.Name.Equals("groupprop1", StringComparison.OrdinalIgnoreCase)));
Assert.Single(resultClass.Properties.Where(static x => x.Name.Equals("groupprop2", StringComparison.OrdinalIgnoreCase)));
}
Expand Down Expand Up @@ -8700,14 +8700,14 @@ public void SupportsIncludeFilterAndExcludeWithOperation()
Assert.NotNull(administrativeUnitsRS);
Assert.Single(administrativeUnitsRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Post));
Assert.Single(administrativeUnitsRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Get));
Assert.Empty(administrativeUnitsRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Put));
Assert.DoesNotContain(administrativeUnitsRS.Methods, static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Put);
var administrativeUnitsItemsNS = codeModel.FindNamespaceByName("TestSdk.directory.administrativeUnits.item");
Assert.NotNull(administrativeUnitsItemsNS);
var administrativeUnitItemsRS = administrativeUnitsItemsNS.FindChildByName<CodeClass>("AdministrativeUnitsItemRequestBuilder");
Assert.NotNull(administrativeUnitItemsRS);
Assert.Single(administrativeUnitItemsRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Get));
Assert.Single(administrativeUnitItemsRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Patch));
Assert.Empty(administrativeUnitItemsRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Delete));
Assert.DoesNotContain(administrativeUnitItemsRS.Methods, static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Delete);
}
[Fact]
public void SupportsIncludeFilterAndExcludeWithOperationForSpecificPath()
Expand Down Expand Up @@ -8845,14 +8845,14 @@ public void SupportsIncludeFilterAndExcludeWithOperationForSpecificPath()
Assert.NotNull(administrativeUnitsRS);
Assert.Single(administrativeUnitsRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Post));
Assert.Single(administrativeUnitsRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Get));
Assert.Empty(administrativeUnitsRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Put));
Assert.DoesNotContain(administrativeUnitsRS.Methods, static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Put);
var administrativeUnitsItemsNS = codeModel.FindNamespaceByName("TestSdk.directory.administrativeUnits.item");
Assert.NotNull(administrativeUnitsItemsNS);
var administrativeUnitItemsRS = administrativeUnitsItemsNS.FindChildByName<CodeClass>("AdministrativeUnitsItemRequestBuilder");
Assert.NotNull(administrativeUnitItemsRS);
Assert.Single(administrativeUnitItemsRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Get));
Assert.Single(administrativeUnitItemsRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Patch));
Assert.Empty(administrativeUnitItemsRS.Methods.Where(static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Delete));
Assert.DoesNotContain(administrativeUnitItemsRS.Methods, static x => x.IsOfKind(CodeMethodKind.RequestExecutor) && x.HttpMethod == Builder.CodeDOM.HttpMethod.Delete);
}
[Fact]
public void CleansUpOperationIdAddsMissingOperationId()
Expand Down
24 changes: 12 additions & 12 deletions tests/Kiota.Builder.Tests/Refiners/GoLanguageRefinerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public async Task TrimsCircularDiscriminatorReferences()
baseModel.DiscriminatorInformation.AddDiscriminatorMapping("DerivedModel", new CodeType { Name = derivedModel.Name, TypeDefinition = derivedModel });
await ILanguageRefiner.Refine(new GenerationConfiguration { Language = GenerationLanguage.Go }, root);
Assert.Empty(baseModel.DiscriminatorInformation.DiscriminatorMappings);
Assert.Empty(baseModel.Usings.Where(x => x.Name.Equals("models.sub", StringComparison.OrdinalIgnoreCase)));
Assert.DoesNotContain(baseModel.Usings, x => x.Name.Equals("models.sub", StringComparison.OrdinalIgnoreCase));
}

[Fact]
Expand Down Expand Up @@ -912,7 +912,7 @@ public async Task AddsErrorImportForEnumsForMultiValueEnum()
Flags = true
}).First();
await ILanguageRefiner.Refine(new GenerationConfiguration { Language = GenerationLanguage.Go }, root);
Assert.Empty(testEnum.Usings.Where(static x => "errors".Equals(x.Name, StringComparison.Ordinal)));
Assert.DoesNotContain(testEnum.Usings, static x => "errors".Equals(x.Name, StringComparison.Ordinal));
Assert.Single(testEnum.Usings.Where(static x => "strings".Equals(x.Name, StringComparison.Ordinal)));
}
[Fact]
Expand All @@ -924,8 +924,8 @@ public async Task AddsErrorImportForEnumsForSingleValueEnum()
Flags = false
}).First();
await ILanguageRefiner.Refine(new GenerationConfiguration { Language = GenerationLanguage.Go }, root);
Assert.Empty(testEnum.Usings.Where(static x => "errors".Equals(x.Name, StringComparison.Ordinal)));
Assert.Empty(testEnum.Usings.Where(static x => "strings".Equals(x.Name, StringComparison.Ordinal)));
Assert.DoesNotContain(testEnum.Usings, static x => "errors".Equals(x.Name, StringComparison.Ordinal));
Assert.DoesNotContain(testEnum.Usings, static x => "strings".Equals(x.Name, StringComparison.Ordinal));
}
[Fact]
public async Task CorrectsCoreType()
Expand Down Expand Up @@ -1035,12 +1035,12 @@ public async Task CorrectsCoreType()
}).First();
root.AddNamespace("ApiSdk/models"); // so the interface copy refiner goes through
await ILanguageRefiner.Refine(new GenerationConfiguration { Language = GenerationLanguage.Go }, root);
Assert.Empty(model.Properties.Where(static x => requestAdapterDefaultName.Equals(x.Type.Name)));
Assert.Empty(model.Properties.Where(static x => factoryDefaultName.Equals(x.Type.Name)));
Assert.Empty(model.Properties.Where(static x => dateTimeOffsetDefaultName.Equals(x.Type.Name)));
Assert.Empty(model.Properties.Where(static x => additionalDataDefaultName.Equals(x.Type.Name)));
Assert.Empty(model.Methods.Where(static x => deserializeDefaultName.Equals(x.ReturnType.Name)));
Assert.Empty(model.Methods.SelectMany(static x => x.Parameters).Where(static x => serializerDefaultName.Equals(x.Type.Name)));
Assert.DoesNotContain(model.Properties, static x => requestAdapterDefaultName.Equals(x.Type.Name));
Assert.DoesNotContain(model.Properties, static x => factoryDefaultName.Equals(x.Type.Name));
Assert.DoesNotContain(model.Properties, static x => dateTimeOffsetDefaultName.Equals(x.Type.Name));
Assert.DoesNotContain(model.Properties, static x => additionalDataDefaultName.Equals(x.Type.Name));
Assert.DoesNotContain(model.Methods, static x => deserializeDefaultName.Equals(x.ReturnType.Name));
Assert.DoesNotContain(model.Methods.SelectMany(static x => x.Parameters), static x => serializerDefaultName.Equals(x.Type.Name));
Assert.Equal("make(map[string]string)", pathParamsProp.DefaultValue);
Assert.Equal("map[string]string", pathParamsProp.Type.Name);
Assert.False(rawUrlParam.Type.IsNullable);
Expand Down Expand Up @@ -1103,7 +1103,7 @@ public async Task RemovesPropertyRelyingOnSubModules()
});
await ILanguageRefiner.Refine(new GenerationConfiguration { Language = GenerationLanguage.Go }, root);
Assert.Empty(mainModel.Properties);
Assert.Empty(mainModel.Methods.Where(x => x.IsAccessor));
Assert.DoesNotContain(mainModel.Methods, x => x.IsAccessor);
}
[Fact]
public async Task AddsMethodsOverloads()
Expand Down Expand Up @@ -1153,7 +1153,7 @@ public async Task AddsMethodsOverloads()
await ILanguageRefiner.Refine(new GenerationConfiguration { Language = GenerationLanguage.Go }, root);
var childMethods = builder.Methods;
Assert.DoesNotContain(childMethods, x => x.IsOverload && x.IsOfKind(CodeMethodKind.RequestExecutor)); // no executor overloads
Assert.Empty(childMethods.Where(x => x.IsOverload && x.IsOfKind(CodeMethodKind.RequestGenerator))); // no generator overloads
Assert.DoesNotContain(childMethods, x => x.IsOverload && x.IsOfKind(CodeMethodKind.RequestGenerator)); // no generator overloads
Assert.Contains(childMethods, x => !x.IsOverload && x.IsOfKind(CodeMethodKind.RequestExecutor) && x.Parameters.Count() == 2);// body + query
Assert.Contains(childMethods, x => !x.IsOverload && x.IsOfKind(CodeMethodKind.RequestGenerator) && x.Parameters.Count() == 3);// ctx + body + query config
Assert.Equal(2, childMethods.Count());
Expand Down
14 changes: 7 additions & 7 deletions tests/Kiota.Builder.Tests/Refiners/JavaLanguageRefinerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -579,13 +579,13 @@ public async Task CorrectsCoreType()
}
});
await ILanguageRefiner.Refine(new GenerationConfiguration { Language = GenerationLanguage.Java }, root);
Assert.Empty(model.Properties.Where(static x => requestAdapterDefaultName.Equals(x.Type.Name)));
Assert.Empty(model.Properties.Where(static x => factoryDefaultName.Equals(x.Type.Name)));
Assert.Empty(model.Properties.Where(static x => dateTimeOffsetDefaultName.Equals(x.Type.Name)));
Assert.Empty(model.Properties.Where(static x => additionalDataDefaultName.Equals(x.Type.Name)));
Assert.Empty(model.Methods.Where(static x => deserializeDefaultName.Equals(x.ReturnType.Name)));
Assert.Empty(model.Methods.SelectMany(static x => x.Parameters).Where(static x => serializerDefaultName.Equals(x.Type.Name)));
Assert.Empty(model.StartBlock.Implements.Where(static x => additionalDataHolderDefaultName.Equals(x.Name, StringComparison.OrdinalIgnoreCase)));
Assert.DoesNotContain(model.Properties, static x => requestAdapterDefaultName.Equals(x.Type.Name));
Assert.DoesNotContain(model.Properties, static x => factoryDefaultName.Equals(x.Type.Name));
Assert.DoesNotContain(model.Properties, static x => dateTimeOffsetDefaultName.Equals(x.Type.Name));
Assert.DoesNotContain(model.Properties, static x => additionalDataDefaultName.Equals(x.Type.Name));
Assert.DoesNotContain(model.Methods, static x => deserializeDefaultName.Equals(x.ReturnType.Name));
Assert.DoesNotContain(model.Methods.SelectMany(static x => x.Parameters), static x => serializerDefaultName.Equals(x.Type.Name));
Assert.DoesNotContain(model.StartBlock.Implements, static x => additionalDataHolderDefaultName.Equals(x.Name, StringComparison.OrdinalIgnoreCase));
Assert.Contains(additionalDataHolderDefaultName[1..], model.StartBlock.Implements.Select(static x => x.Name).ToList());
}
[Fact]
Expand Down
16 changes: 8 additions & 8 deletions tests/Kiota.Builder.Tests/Refiners/PythonLanguageRefinerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,14 @@ public async Task CorrectsCoreType()
},
});
await ILanguageRefiner.Refine(new GenerationConfiguration { Language = GenerationLanguage.Python }, root);
Assert.Empty(model.Properties.Where(x => HttpCoreDefaultName.Equals(x.Type.Name)));
Assert.Empty(model.Properties.Where(x => FactoryDefaultName.Equals(x.Type.Name)));
Assert.Empty(model.Properties.Where(x => DateTimeOffsetDefaultName.Equals(x.Type.Name)));
Assert.Empty(model.Properties.Where(x => AdditionalDataDefaultName.Equals(x.Type.Name)));
Assert.Empty(model.Properties.Where(x => PathParametersDefaultName.Equals(x.Type.Name)));
Assert.Empty(model.Properties.Where(x => PathParametersDefaultValue.Equals(x.DefaultValue)));
Assert.Empty(model.Methods.Where(x => DeserializeDefaultName.Equals(x.ReturnType.Name)));
Assert.Empty(model.Methods.SelectMany(x => x.Parameters).Where(x => serializerDefaultName.Equals(x.Type.Name)));
Assert.DoesNotContain(model.Properties, x => HttpCoreDefaultName.Equals(x.Type.Name));
Assert.DoesNotContain(model.Properties, x => FactoryDefaultName.Equals(x.Type.Name));
Assert.DoesNotContain(model.Properties, x => DateTimeOffsetDefaultName.Equals(x.Type.Name));
Assert.DoesNotContain(model.Properties, x => AdditionalDataDefaultName.Equals(x.Type.Name));
Assert.DoesNotContain(model.Properties, x => PathParametersDefaultName.Equals(x.Type.Name));
Assert.DoesNotContain(model.Properties, x => PathParametersDefaultValue.Equals(x.DefaultValue));
Assert.DoesNotContain(model.Methods, x => DeserializeDefaultName.Equals(x.ReturnType.Name));
Assert.DoesNotContain(model.Methods.SelectMany(x => x.Parameters), x => serializerDefaultName.Equals(x.Type.Name));
Assert.Single(constructorMethod.Parameters.Where(x => x.Type is CodeTypeBase));
}
[Fact]
Expand Down
Loading

0 comments on commit 4d3866a

Please sign in to comment.