Skip to content

Commit 80e3b47

Browse files
committed
Bump xunit to 2.8.0
1 parent a65dcb6 commit 80e3b47

24 files changed

+58
-58
lines changed

Directory.Packages.props

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@
108108
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.5.0-preview-20221003-04" />
109109
<PackageVersion Include="Moq" Version="4.16.1" />
110110
<PackageVersion Include="Verify.Xunit" Version="14.2.0" />
111-
<PackageVersion Include="xunit" Version="2.4.2" />
112-
<PackageVersion Include="xunit.analyzers" Version="1.0.0"/>
113-
<PackageVersion Include="xunit.assert" Version="2.4.2" />
114-
<PackageVersion Include="xunit.combinatorial" Version="1.5.25" />
115-
<PackageVersion Include="xunit.extensibility.core" Version="2.4.2" />
116-
<PackageVersion Include="xunit.extensibility.execution" Version="2.4.2" />
117-
<PackageVersion Include="xunit.runner.console" Version="2.4.2" />
118-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
111+
<PackageVersion Include="xunit" Version="2.8.0" />
112+
<PackageVersion Include="xunit.analyzers" Version="1.13.0"/>
113+
<PackageVersion Include="xunit.assert" Version="2.8.0" />
114+
<PackageVersion Include="xunit.combinatorial" Version="1.6.24" />
115+
<PackageVersion Include="xunit.extensibility.core" Version="2.8.0" />
116+
<PackageVersion Include="xunit.extensibility.execution" Version="2.8.0" />
117+
<PackageVersion Include="xunit.runner.console" Version="2.8.0" />
118+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.0" />
119119

120120
<!-- Integration Tests -->
121121
<PackageVersion Include="Microsoft.DotNet.Common.ProjectTemplates.1.x" Version="1.0.0-beta2-20170629-269" />

tests/Microsoft.VisualStudio.ProjectSystem.Managed.TestServices/AssertEx.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ internal static class AssertEx
99
{
1010
public static void CollectionLength<T>(IEnumerable<T> collection, int expectedCount)
1111
{
12-
int actualCount = collection.Count();
12+
int count = collection.Count();
1313

14-
if (actualCount != expectedCount)
14+
if (count != expectedCount)
1515
{
16-
throw new CollectionException(collection, expectedCount, actualCount);
16+
throw CollectionException.ForMismatchedItemCount(expectedCount, count, "Collection lengths not equal.");
1717
}
1818
}
1919

tests/Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests/Mocks/IProjectPropertiesFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static Mock<IProjectProperties> MockWithProperties(IEnumerable<string> pr
2121
return mock;
2222
}
2323

24-
public static Mock<IProjectProperties> MockWithPropertyAndValue(string propertyName, string setValue)
24+
public static Mock<IProjectProperties> MockWithPropertyAndValue(string propertyName, string? setValue)
2525
{
2626
return MockWithPropertiesAndValues(new Dictionary<string, string?>() { { propertyName, setValue } });
2727
}
@@ -72,7 +72,7 @@ public static Mock<IProjectProperties> MockWithPropertiesAndValues(IDictionary<s
7272
public static IProjectProperties CreateWithProperty(string propertyName)
7373
=> MockWithProperty(propertyName).Object;
7474

75-
public static IProjectProperties CreateWithPropertyAndValue(string propertyName, string setValue)
75+
public static IProjectProperties CreateWithPropertyAndValue(string propertyName, string? setValue)
7676
=> MockWithPropertyAndValue(propertyName, setValue).Object;
7777

7878
public static IProjectProperties CreateWithPropertiesAndValues(IDictionary<string, string?> propertyNameAndValues, HashSet<string>? inheritedPropertyNames = null)

tests/Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests/ProjectSystem/Build/StartupProjectSingleTargetGlobalBuildPropertyProviderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public async Task VerifyExpectedBehaviors(string projectPath, bool crossTargetin
5858

5959
if (expectTargetFrameworkSet)
6060
{
61-
Assert.Equal(expected: 1, actual: globalProperties.Count);
61+
Assert.Single(globalProperties);
6262
Assert.Equal(expected: "myFramework1.0", actual: globalProperties[ConfigurationGeneral.TargetFrameworkProperty]);
6363
}
6464
else

tests/Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests/ProjectSystem/Build/TargetFrameworkGlobalBuildPropertyProviderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task VerifyNoTargetFrameworkOverrideForRegularBuild()
3636
var provider = new TargetFrameworkGlobalBuildPropertyProvider(projectService, configuredProject);
3737

3838
var properties = await provider.GetGlobalPropertiesAsync(CancellationToken.None);
39-
Assert.Equal(0, properties.Count);
39+
Assert.Empty(properties);
4040
}
4141
}
4242
}

tests/Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests/ProjectSystem/Debug/DebugTokenReplacerTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ public async Task ReplaceTokensInProfileTests()
6868
[InlineData("this is msbuild: %env3% $(msbuildProperty2) $(msbuildProperty3)", "this is msbuild: Property6 Property2 Property3", true)]
6969
[InlineData(null, null, true)]
7070
[InlineData(" ", " ", true)]
71-
public async Task ReplaceTokensInStringTests(string input, string expected, bool expandEnvVars)
71+
public async Task ReplaceTokensInStringTests(string? input, string? expected, bool expandEnvVars)
7272
{
7373
var replacer = CreateInstance();
7474

75-
// Test msbuild vars
76-
string result = await replacer.ReplaceTokensInStringAsync(input, expandEnvVars);
75+
// Test MSBuild vars
76+
string? result = await replacer.ReplaceTokensInStringAsync(input!, expandEnvVars);
7777
Assert.Equal(expected, result);
7878
}
7979

tests/Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests/ProjectSystem/FileItemServicesTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void GetLogicalFolderNames_EmptyAsFullPath_ThrowsArgument()
7575
[InlineData("C:\\Folder\\Project", "C:\\Folder\\Project\\Source.cs", "Folder\\..\\..\\Source.cs", null)]
7676
[InlineData("C:\\Folder\\Project", "C:\\Folder\\Project\\Source.cs", "D:\\Folder\\Source.cs", null)]
7777
[InlineData("C:\\Folder\\Project", "C:\\Folder\\Project\\Source.cs", "C:\\Folder\\Project\\Source.cs", null)]
78-
public void GetLogicalFolderNames_Returns(string basePath, string fullPath, string link, params string[] expected)
78+
public void GetLogicalFolderNames_Returns(string basePath, string fullPath, string? link, params string?[] expected)
7979
{
8080
var metadata = ImmutableDictionary<string, string>.Empty;
8181
if (link is not null)

tests/Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests/ProjectSystem/OnceInitializedOnceDisposedUnderLockAsyncTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ namespace Microsoft.VisualStudio.ProjectSystem
77
public class OnceInitializedOnceDisposedUnderLockAsyncTests
88
{
99
[Fact]
10-
public void ExecuteUnderLockAsync_NullAsAction_ThrowsArgumentNullException()
10+
public async Task ExecuteUnderLockAsync_NullAsAction_ThrowsArgumentNullException()
1111
{
1212
var instance = CreateInstance();
1313

14-
Assert.ThrowsAsync<ArgumentNullException>(() =>
14+
await Assert.ThrowsAsync<ArgumentNullException>(() =>
1515
{
1616
return instance.ExecuteUnderLockAsync(null!, CancellationToken.None);
1717
});
1818
}
1919

2020
[Fact]
21-
public void ExecuteUnderLockAsyncOfT_NullAsAction_ThrowsArgumentNullException()
21+
public async Task ExecuteUnderLockAsyncOfT_NullAsAction_ThrowsArgumentNullException()
2222
{
2323
var instance = CreateInstance();
2424

25-
Assert.ThrowsAsync<ArgumentNullException>(() =>
25+
await Assert.ThrowsAsync<ArgumentNullException>(() =>
2626
{
2727
return instance.ExecuteUnderLockAsync<string>(null!, CancellationToken.None);
2828
});

tests/Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests/ProjectSystem/Properties/AssemblyInfoPropertiesProviderTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private static TestProjectFileOrAssemblyInfoPropertiesProvider CreateProviderFor
7070
private static TestProjectFileOrAssemblyInfoPropertiesProvider CreateProviderForProjectFileValidation(
7171
string code,
7272
string propertyName,
73-
string propertyValueInProjectFile,
73+
string? propertyValueInProjectFile,
7474
out Workspace workspace,
7575
Lazy<IInterceptingPropertyValueProvider, IInterceptingPropertyValueProviderMetadata2>? interceptingProvider = null,
7676
Dictionary<string, string?>? additionalProps = null)
@@ -151,7 +151,7 @@ public async Task SourceFileProperties_GetEvaluatedPropertyAsync(string code, st
151151
[InlineData("""[assembly: System.Reflection.AssemblyDescriptionAttribute(true)]""", "Description", "MyDescription", "MyDescription")]
152152
[InlineData("""[assembly: System.Reflection.AssemblyDescriptionAttribute("MyDescription"]""", "Description", "", "")]
153153
[InlineData("""[assembly: System.Reflection.AssemblyDescriptionAttribute("MyDescription"]""", "Description", null, "")]
154-
public async Task ProjectFileProperties_GetEvaluatedPropertyAsync(string code, string propertyName, string propertyValueInProjectFile, string expectedValue)
154+
public async Task ProjectFileProperties_GetEvaluatedPropertyAsync(string code, string propertyName, string? propertyValueInProjectFile, string expectedValue)
155155
{
156156
var provider = CreateProviderForProjectFileValidation(code, propertyName, propertyValueInProjectFile, out Workspace workspace);
157157
var projectFilePath = workspace.CurrentSolution.Projects.First().FilePath;
@@ -276,7 +276,7 @@ public async Task ProjectFileProperties_GetUnevaluatedPropertyAsync(string code,
276276
[InlineData("""[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.0.0")]""", "Version", "2.0.0", null)]
277277
[InlineData("""[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2.0.1-beta1")]""", "Version", "2.0.1-beta1", null)]
278278
[InlineData("""[assembly: System.Reflection.AssemblyInformationalVersionAttribute("2016.2")]""", "Version", "2016.2", null)]
279-
internal async Task SourceFileProperties_DefaultValues_GetEvaluatedPropertyAsync(string code, string propertyName, string expectedValue, Type interceptingProviderType)
279+
internal async Task SourceFileProperties_DefaultValues_GetEvaluatedPropertyAsync(string code, string propertyName, string expectedValue, Type? interceptingProviderType)
280280
{
281281
var interceptingProvider = interceptingProviderType is not null
282282
? new Lazy<IInterceptingPropertyValueProvider, IInterceptingPropertyValueProviderMetadata2>(
@@ -306,7 +306,7 @@ internal async Task SourceFileProperties_DefaultValues_GetEvaluatedPropertyAsync
306306
[InlineData("MyApp", "Product", null, "")]
307307
[InlineData("MyApp", "Product", "", "")]
308308
[InlineData("MyApp", "Product", "ExistingValue", "ExistingValue")]
309-
internal async Task ProjectFileProperties_DefaultValues_GetEvaluatedPropertyAsync(string assemblyName, string propertyName, string existingPropertyValue, string expectedValue)
309+
internal async Task ProjectFileProperties_DefaultValues_GetEvaluatedPropertyAsync(string assemblyName, string propertyName, string? existingPropertyValue, string expectedValue)
310310
{
311311
var additionalProps = new Dictionary<string, string?>() { { "AssemblyName", assemblyName } };
312312

@@ -350,7 +350,7 @@ internal async Task ProjectFileProperties_DefaultValues_GetEvaluatedPropertyAsyn
350350
[InlineData("Version", "1.1.1", "1.0.0.0", "1.0.0.0", null)]
351351
[InlineData("Version", "1.0.0", "1.0.0.0", "1.0.0.0", null)]
352352
[InlineData("Version", null, "2016.2", "2016.2", null)]
353-
internal async Task ProjectFileProperties_WithInterception_SetEvaluatedPropertyAsync(string propertyName, string existingPropertyValue, string propertyValueToSet, string expectedValue, Type interceptingProviderType)
353+
internal async Task ProjectFileProperties_WithInterception_SetEvaluatedPropertyAsync(string propertyName, string? existingPropertyValue, string propertyValueToSet, string expectedValue, Type? interceptingProviderType)
354354
{
355355
var interceptingProvider = interceptingProviderType is not null
356356
? new Lazy<IInterceptingPropertyValueProvider, IInterceptingPropertyValueProviderMetadata2>(

tests/Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests/ProjectSystem/Properties/InterceptingProjectProperties/ApplicationManifestValueProviderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class ApplicationManifestValueProviderTests
1111
[InlineData("", "TRue", "NoManifest")]
1212
[InlineData("", "false", "DefaultManifest")]
1313
[InlineData("", null, "DefaultManifest")]
14-
public async Task GetApplicationManifest(string appManifestPropValue, string noManifestValue, string expectedValue)
14+
public async Task GetApplicationManifest(string appManifestPropValue, string? noManifestValue, string expectedValue)
1515
{
1616
var provider = new ApplicationManifestValueProvider(UnconfiguredProjectFactory.Create());
1717
var defaultProperties = IProjectPropertiesFactory.CreateWithPropertyAndValue("NoWin32Manifest", noManifestValue);

0 commit comments

Comments
 (0)