diff --git a/WEB/Src/Web/Web.Tests/Web.Tests.csproj b/WEB/Src/Web/Web.Tests/Web.Tests.csproj
index 4631a06068..7561a778f0 100644
--- a/WEB/Src/Web/Web.Tests/Web.Tests.csproj
+++ b/WEB/Src/Web/Web.Tests/Web.Tests.csproj
@@ -38,6 +38,10 @@
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
diff --git a/WEB/Src/WindowsServer/WindowsServer.Tests/AzureInstanceMetadataTests.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/AzureInstanceMetadataTests.cs
index c44937aa66..2f17c683c9 100644
--- a/WEB/Src/WindowsServer/WindowsServer.Tests/AzureInstanceMetadataTests.cs
+++ b/WEB/Src/WindowsServer/WindowsServer.Tests/AzureInstanceMetadataTests.cs
@@ -210,7 +210,7 @@ public void AzureIMSTestFieldBadValuesFailVerification()
public void AzureIMSGetFieldByNameFailsWithException()
{
AzureInstanceComputeMetadata md = new AzureInstanceComputeMetadata();
- Assert.Throws(typeof(ArgumentOutOfRangeException), () => md.GetValueForField("not-a-field"));
+ Assert.Throws(() => md.GetValueForField("not-a-field"));
}
[TestMethod]
diff --git a/WEB/Src/WindowsServer/WindowsServer.Tests/FirstChanceExceptionStatisticsTelemetryModuleTest.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/FirstChanceExceptionStatisticsTelemetryModuleTest.cs
index a793c0e64a..4bfcdd1cad 100644
--- a/WEB/Src/WindowsServer/WindowsServer.Tests/FirstChanceExceptionStatisticsTelemetryModuleTest.cs
+++ b/WEB/Src/WindowsServer/WindowsServer.Tests/FirstChanceExceptionStatisticsTelemetryModuleTest.cs
@@ -117,17 +117,17 @@ public void FirstChanceExceptionStatisticsTelemetryModuleTracksMetricWithTypeAnd
}
}
- Assert.Equal(1, metrics.Count);
+ Assert.Single(metrics);
Assert.Equal("Exceptions thrown", metrics[0].Key.Name);
var dims = metrics[0].Key.Dimensions;
Assert.Equal(1, dims.Count);
- Assert.True(dims["problemId"].StartsWith(typeof(Exception).FullName, StringComparison.Ordinal));
+ Assert.StartsWith(typeof(Exception).FullName, dims["problemId"], StringComparison.Ordinal);
int nameStart = dims["problemId"].IndexOf(" at ", StringComparison.OrdinalIgnoreCase) + 4;
- Assert.True(dims["problemId"].Substring(nameStart).StartsWith(typeof(FirstChanceExceptionStatisticsTelemetryModuleTest).FullName + "." + nameof(this.FirstChanceExceptionStatisticsTelemetryModuleTracksMetricWithTypeAndMethodOnException), StringComparison.Ordinal));
+ Assert.StartsWith(typeof(FirstChanceExceptionStatisticsTelemetryModuleTest).FullName + "." + nameof(this.FirstChanceExceptionStatisticsTelemetryModuleTracksMetricWithTypeAndMethodOnException), dims["problemId"].Substring(nameStart), StringComparison.Ordinal);
}
[TestMethod]
@@ -175,7 +175,7 @@ public void FirstChanceExceptionStatisticsTelemetryModuleUsesSetsInternalOperati
}
}
- Assert.Equal(1, metrics.Count);
+ Assert.Single(metrics);
Assert.Equal("Exceptions thrown", metrics[0].Key.Name);
var dims = metrics[0].Key.Dimensions;
@@ -221,7 +221,7 @@ public void FirstChanceExceptionStatisticsTelemetryModuleUsesOperationNameAsDime
}
}
- Assert.Equal(1, metrics.Count);
+ Assert.Single(metrics);
Assert.Equal("Exceptions thrown", metrics[0].Key.Name);
var dims = metrics[0].Key.Dimensions;
@@ -265,7 +265,7 @@ public void FirstChanceExceptionStatisticsTelemetryModuleMarksOperationAsInterna
}
}
- Assert.Equal(1, metrics.Count);
+ Assert.Single(metrics);
Assert.Equal("Exceptions thrown", metrics[0].Key.Name);
var dims = metrics[0].Key.Dimensions;
@@ -520,7 +520,7 @@ public void FirstChanceExceptionStatisticsTelemetryModuleDoNotIncrementOnRethrow
}
}
- Assert.Equal(1, metrics.Count);
+ Assert.Single(metrics);
Assert.Equal("Exceptions thrown", metrics[0].Key.Name);
Assert.Equal(1, metrics[0].Value, 15);
diff --git a/WEB/Src/WindowsServer/WindowsServer.Tests/WindowsServer.Tests.csproj b/WEB/Src/WindowsServer/WindowsServer.Tests/WindowsServer.Tests.csproj
index 49d77839f9..2e8c495162 100644
--- a/WEB/Src/WindowsServer/WindowsServer.Tests/WindowsServer.Tests.csproj
+++ b/WEB/Src/WindowsServer/WindowsServer.Tests/WindowsServer.Tests.csproj
@@ -15,11 +15,11 @@
-
-
-
-
-
+
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+