Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nkolev92 committed Aug 15, 2024
1 parent a69dd46 commit 043796f
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,19 @@ public void RestoreMetadataWithMacros_RoundTrips()
var actual = PackageSpecTestUtility.RoundTripJson(json, environmentReader);

// Assert
var metadata = actual.RestoreMetadata;
var userSettingsDirectory = NuGetEnvironment.GetFolderPath(NuGetFolderPath.UserSettingsDirectory);

Assert.NotNull(metadata);
metadata.PackagesPath.Should().Be(@$"{userSettingsDirectory}.nuget\packages");

Check failure on line 824 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on Linux (.NET Core 3.1) Unit Tests on Linux (.NET Core 3.1))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L824

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(824,35): Error CS1061: 'string' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 824 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on Linux (.NET 8.0) Unit Tests on Linux (.NET 8.0))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L824

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(824,35): Error CS1061: 'string' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 824 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on MacOS (.NET 8.0) Unit Tests on MacOS (.NET 8.0))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L824

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(824,35): Error CS1061: 'string' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 824 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on MacOS (.NET Core 3.1) Unit Tests on MacOS (.NET Core 3.1))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L824

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(824,35): Error CS1061: 'string' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)

metadata.ConfigFilePaths.Should().Contain(@$"{userSettingsDirectory}source\code\NuGet.Config");

Check failure on line 826 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on Linux (.NET Core 3.1) Unit Tests on Linux (.NET Core 3.1))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L826

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(826,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 826 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on Linux (.NET 8.0) Unit Tests on Linux (.NET 8.0))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L826

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(826,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 826 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on MacOS (.NET 8.0) Unit Tests on MacOS (.NET 8.0))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L826

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(826,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 826 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on MacOS (.NET Core 3.1) Unit Tests on MacOS (.NET Core 3.1))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L826

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(826,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)
metadata.ConfigFilePaths.Should().Contain(@"C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.FallbackLocation.config");

Check failure on line 827 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on Linux (.NET Core 3.1) Unit Tests on Linux (.NET Core 3.1))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L827

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(827,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 827 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on Linux (.NET 8.0) Unit Tests on Linux (.NET 8.0))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L827

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(827,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 827 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on MacOS (.NET 8.0) Unit Tests on MacOS (.NET 8.0))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L827

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(827,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 827 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on MacOS (.NET Core 3.1) Unit Tests on MacOS (.NET Core 3.1))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L827

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(827,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)
metadata.ConfigFilePaths.Should().Contain(@"C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config");

Check failure on line 828 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on Linux (.NET Core 3.1) Unit Tests on Linux (.NET Core 3.1))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L828

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(828,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 828 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on Linux (.NET 8.0) Unit Tests on Linux (.NET 8.0))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L828

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(828,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 828 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on MacOS (.NET 8.0) Unit Tests on MacOS (.NET 8.0))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L828

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(828,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 828 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on MacOS (.NET Core 3.1) Unit Tests on MacOS (.NET Core 3.1))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L828

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(828,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)
metadata.ConfigFilePaths.Should().Contain(@$"{userSettingsDirectory}AppData\Roaming\NuGet\NuGet.Config");

Check failure on line 829 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on Linux (.NET Core 3.1) Unit Tests on Linux (.NET Core 3.1))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L829

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(829,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 829 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on Linux (.NET 8.0) Unit Tests on Linux (.NET 8.0))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L829

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(829,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 829 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on MacOS (.NET 8.0) Unit Tests on MacOS (.NET 8.0))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L829

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(829,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 829 in test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs

View check run for this annotation

Azure Pipelines / NuGet.Client CI (Unit Tests on MacOS (.NET Core 3.1) Unit Tests on MacOS (.NET Core 3.1))

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs#L829

test/NuGet.Core.Tests/NuGet.ProjectModel.Test/PackageSpecWriterTests.cs(829,38): Error CS1061: 'IList<string>' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'IList<string>' could be found (are you missing a using directive or an assembly reference?)

metadata.FallbackFolders.Should().Contain(@"C:\Program Files\dotnet\sdk\NuGetFallbackFolder");
metadata.FallbackFolders.Should().Contain(@$"{userSettingsDirectory}fallbackFolder");
}

private static string GetJsonString(PackageSpec packageSpec)
Expand Down

0 comments on commit 043796f

Please sign in to comment.