Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions WEB/Src/Web/Web.Tests/Web.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="OpenCover" Version="4.7.922" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<Import Project="..\..\TestFramework\Shared\TestFramework.Shared.projitems" Label="Shared" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -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<ArgumentOutOfRangeException>(() => md.GetValueForField("not-a-field"));
}

[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="xunit.abstractions" Version="2.0.1" />
<PackageReference Include="xunit.assert" Version="2.3.1" />
<PackageReference Include="xunit.core" Version="2.3.1" />
<PackageReference Include="xunit.extensibility.core" Version="2.3.1" />
<PackageReference Include="xunit.extensibility.execution" Version="2.3.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
Expand Down