From d0f8a9e3e6600cb738498c980c0f0a7d18be9d24 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 14:08:24 +0000 Subject: [PATCH 1/2] chore(deps): bump xunit from 2.7.0 to 2.9.0 Bumps [xunit](https://github.com/xunit/xunit) from 2.7.0 to 2.9.0. - [Commits](https://github.com/xunit/xunit/compare/2.7.0...2.9.0) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .../Kiota.Builder.IntegrationTests.csproj | 2 +- tests/Kiota.Builder.Tests/Kiota.Builder.Tests.csproj | 2 +- tests/Kiota.Tests/Kiota.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Kiota.Builder.IntegrationTests/Kiota.Builder.IntegrationTests.csproj b/tests/Kiota.Builder.IntegrationTests/Kiota.Builder.IntegrationTests.csproj index c8aeabd781..7ffe203572 100644 --- a/tests/Kiota.Builder.IntegrationTests/Kiota.Builder.IntegrationTests.csproj +++ b/tests/Kiota.Builder.IntegrationTests/Kiota.Builder.IntegrationTests.csproj @@ -16,7 +16,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/tests/Kiota.Builder.Tests/Kiota.Builder.Tests.csproj b/tests/Kiota.Builder.Tests/Kiota.Builder.Tests.csproj index 79f4c7bede..0415d357ae 100644 --- a/tests/Kiota.Builder.Tests/Kiota.Builder.Tests.csproj +++ b/tests/Kiota.Builder.Tests/Kiota.Builder.Tests.csproj @@ -19,7 +19,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/tests/Kiota.Tests/Kiota.Tests.csproj b/tests/Kiota.Tests/Kiota.Tests.csproj index 5589eb1c2c..42c6bcba83 100644 --- a/tests/Kiota.Tests/Kiota.Tests.csproj +++ b/tests/Kiota.Tests/Kiota.Tests.csproj @@ -12,7 +12,7 @@ all - + runtime; build; native; contentfiles; analyzers; buildtransitive all From cbc7f9c319a07bc2cb5a5cfd73e628efa6f00f76 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Thu, 1 Aug 2024 17:19:58 +0300 Subject: [PATCH 2/2] Run dotnet format to fix liniting errors --- .../CodeDOM/CodeBlockTests.cs | 2 +- .../Kiota.Builder.Tests/KiotaBuilderTests.cs | 24 +++++++++---------- .../Refiners/GoLanguageRefinerTests.cs | 24 +++++++++---------- .../Refiners/JavaLanguageRefinerTests.cs | 14 +++++------ .../Refiners/PythonLanguageRefinerTests.cs | 16 ++++++------- .../TypeScriptLanguageRefinerTests.cs | 16 ++++++------- 6 files changed, 48 insertions(+), 48 deletions(-) diff --git a/tests/Kiota.Builder.Tests/CodeDOM/CodeBlockTests.cs b/tests/Kiota.Builder.Tests/CodeDOM/CodeBlockTests.cs index 790477b91b..f68bf1de49 100644 --- a/tests/Kiota.Builder.Tests/CodeDOM/CodeBlockTests.cs +++ b/tests/Kiota.Builder.Tests/CodeDOM/CodeBlockTests.cs @@ -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")); } } diff --git a/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs b/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs index fc0df2d7d5..8be6d794da 100644 --- a/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs +++ b/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs @@ -2667,8 +2667,8 @@ public void DoesntAddPropertyHolderOnNonAdditionalModels() var codeModel = builder.CreateSourceModel(node); var weatherType = codeModel.FindChildByName("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() @@ -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("StudentsRequestBuilder"); Assert.NotNull(studentsRS); @@ -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] @@ -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))); } @@ -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("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() @@ -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("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() diff --git a/tests/Kiota.Builder.Tests/Refiners/GoLanguageRefinerTests.cs b/tests/Kiota.Builder.Tests/Refiners/GoLanguageRefinerTests.cs index 4d2e36bdae..9e9455422d 100644 --- a/tests/Kiota.Builder.Tests/Refiners/GoLanguageRefinerTests.cs +++ b/tests/Kiota.Builder.Tests/Refiners/GoLanguageRefinerTests.cs @@ -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] @@ -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] @@ -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() @@ -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); @@ -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() @@ -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()); diff --git a/tests/Kiota.Builder.Tests/Refiners/JavaLanguageRefinerTests.cs b/tests/Kiota.Builder.Tests/Refiners/JavaLanguageRefinerTests.cs index df2087c009..1813116540 100644 --- a/tests/Kiota.Builder.Tests/Refiners/JavaLanguageRefinerTests.cs +++ b/tests/Kiota.Builder.Tests/Refiners/JavaLanguageRefinerTests.cs @@ -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] diff --git a/tests/Kiota.Builder.Tests/Refiners/PythonLanguageRefinerTests.cs b/tests/Kiota.Builder.Tests/Refiners/PythonLanguageRefinerTests.cs index 432f17db69..6db3ebf72c 100644 --- a/tests/Kiota.Builder.Tests/Refiners/PythonLanguageRefinerTests.cs +++ b/tests/Kiota.Builder.Tests/Refiners/PythonLanguageRefinerTests.cs @@ -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] diff --git a/tests/Kiota.Builder.Tests/Refiners/TypeScriptLanguageRefinerTests.cs b/tests/Kiota.Builder.Tests/Refiners/TypeScriptLanguageRefinerTests.cs index 8da35ab461..8860329959 100644 --- a/tests/Kiota.Builder.Tests/Refiners/TypeScriptLanguageRefinerTests.cs +++ b/tests/Kiota.Builder.Tests/Refiners/TypeScriptLanguageRefinerTests.cs @@ -363,12 +363,12 @@ public async Task CorrectsCoreType() var serializationFunction = codeFile.FindChildByName($"Serialize{model.Name.ToFirstCharacterUpperCase()}"); Assert.NotNull(deserializerFunction); Assert.NotNull(serializationFunction); - Assert.Empty(interFaceModel.Properties.Where(x => HttpCoreDefaultName.Equals(x.Type.Name))); - Assert.Empty(interFaceModel.Properties.Where(x => FactoryDefaultName.Equals(x.Type.Name))); - Assert.Empty(interFaceModel.Properties.Where(x => DateTimeOffsetDefaultName.Equals(x.Type.Name))); - Assert.Empty(interFaceModel.Properties.Where(x => AdditionalDataDefaultName.Equals(x.Type.Name))); - Assert.Empty(interFaceModel.Properties.Where(x => PathParametersDefaultName.Equals(x.Type.Name))); - Assert.Empty(interFaceModel.Properties.Where(x => PathParametersDefaultValue.Equals(x.DefaultValue))); + Assert.DoesNotContain(interFaceModel.Properties, x => HttpCoreDefaultName.Equals(x.Type.Name)); + Assert.DoesNotContain(interFaceModel.Properties, x => FactoryDefaultName.Equals(x.Type.Name)); + Assert.DoesNotContain(interFaceModel.Properties, x => DateTimeOffsetDefaultName.Equals(x.Type.Name)); + Assert.DoesNotContain(interFaceModel.Properties, x => AdditionalDataDefaultName.Equals(x.Type.Name)); + Assert.DoesNotContain(interFaceModel.Properties, x => PathParametersDefaultName.Equals(x.Type.Name)); + Assert.DoesNotContain(interFaceModel.Properties, x => PathParametersDefaultValue.Equals(x.DefaultValue)); Assert.Contains(deserializerFunction.OriginalLocalMethod.Parameters, x => interFaceModel.Name.Equals(x.Type.Name)); Assert.Contains(serializationFunction.OriginalLocalMethod.Parameters, x => "SerializationWriter".Equals(x.Type.Name)); @@ -575,8 +575,8 @@ public async Task AliasesDuplicateUsingSymbols() var source1Interface = modelCodeFile.Interfaces.First(x => x.Name == source1.Name.ToFirstCharacterUpperCase()); var source2Interface = modelCodeFile.Interfaces.First(x => x.Name == source2.Name.ToFirstCharacterUpperCase()); - Assert.Empty(modelInterface.Usings.Where(x => x.Declaration?.TypeDefinition == source2Interface)); - Assert.Empty(modelInterface.Usings.Where(x => x.Declaration?.TypeDefinition == source1Interface)); + Assert.DoesNotContain(modelInterface.Usings, x => x.Declaration?.TypeDefinition == source2Interface); + Assert.DoesNotContain(modelInterface.Usings, x => x.Declaration?.TypeDefinition == source1Interface); } [Fact] public async Task DoesNotKeepCancellationParametersInRequestExecutors()