mirror of
https://github.com/actions/runner.git
synced 2026-01-17 09:12:08 +08:00
Fix IDE0090 (#2211)
This commit is contained in:
@@ -11,7 +11,7 @@ namespace GitHub.Runner.Common.Tests.Util
|
||||
[Trait("Category", "Common")]
|
||||
public void Equal_MatchesObjectEquality()
|
||||
{
|
||||
using (TestHostContext hc = new TestHostContext(this))
|
||||
using (TestHostContext hc = new(this))
|
||||
{
|
||||
Tracing trace = hc.GetTrace();
|
||||
|
||||
@@ -29,12 +29,12 @@ namespace GitHub.Runner.Common.Tests.Util
|
||||
[Trait("Category", "Common")]
|
||||
public void Equal_MatchesReferenceEquality()
|
||||
{
|
||||
using (TestHostContext hc = new TestHostContext(this))
|
||||
using (TestHostContext hc = new(this))
|
||||
{
|
||||
Tracing trace = hc.GetTrace();
|
||||
|
||||
// Arrange.
|
||||
object expected = new object();
|
||||
object expected = new();
|
||||
object actual = expected;
|
||||
|
||||
// Act/Assert.
|
||||
@@ -47,7 +47,7 @@ namespace GitHub.Runner.Common.Tests.Util
|
||||
[Trait("Category", "Common")]
|
||||
public void Equal_MatchesStructEquality()
|
||||
{
|
||||
using (TestHostContext hc = new TestHostContext(this))
|
||||
using (TestHostContext hc = new(this))
|
||||
{
|
||||
Tracing trace = hc.GetTrace();
|
||||
|
||||
@@ -65,12 +65,12 @@ namespace GitHub.Runner.Common.Tests.Util
|
||||
[Trait("Category", "Common")]
|
||||
public void Equal_ThrowsWhenActualObjectIsNull()
|
||||
{
|
||||
using (TestHostContext hc = new TestHostContext(this))
|
||||
using (TestHostContext hc = new(this))
|
||||
{
|
||||
Tracing trace = hc.GetTrace();
|
||||
|
||||
// Arrange.
|
||||
object expected = new object();
|
||||
object expected = new();
|
||||
object actual = null;
|
||||
|
||||
// Act/Assert.
|
||||
@@ -86,13 +86,13 @@ namespace GitHub.Runner.Common.Tests.Util
|
||||
[Trait("Category", "Common")]
|
||||
public void Equal_ThrowsWhenExpectedObjectIsNull()
|
||||
{
|
||||
using (TestHostContext hc = new TestHostContext(this))
|
||||
using (TestHostContext hc = new(this))
|
||||
{
|
||||
Tracing trace = hc.GetTrace();
|
||||
|
||||
// Arrange.
|
||||
object expected = null;
|
||||
object actual = new object();
|
||||
object actual = new();
|
||||
|
||||
// Act/Assert.
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() =>
|
||||
@@ -107,13 +107,13 @@ namespace GitHub.Runner.Common.Tests.Util
|
||||
[Trait("Category", "Common")]
|
||||
public void Equal_ThrowsWhenObjectsAreNotEqual()
|
||||
{
|
||||
using (TestHostContext hc = new TestHostContext(this))
|
||||
using (TestHostContext hc = new(this))
|
||||
{
|
||||
Tracing trace = hc.GetTrace();
|
||||
|
||||
// Arrange.
|
||||
object expected = new object();
|
||||
object actual = new object();
|
||||
object expected = new();
|
||||
object actual = new();
|
||||
|
||||
// Act/Assert.
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() =>
|
||||
@@ -128,7 +128,7 @@ namespace GitHub.Runner.Common.Tests.Util
|
||||
[Trait("Category", "Common")]
|
||||
public void Equal_ThrowsWhenStructsAreNotEqual()
|
||||
{
|
||||
using (TestHostContext hc = new TestHostContext(this))
|
||||
using (TestHostContext hc = new(this))
|
||||
{
|
||||
Tracing trace = hc.GetTrace();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user