Skip to content

Commit

Permalink
Fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bibletoon committed Sep 26, 2021
1 parent f32cc29 commit a260ea6
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,20 @@ public static void Ctor_String_String()
public static void Throw_Object()
{
var obj = new object();
AssertExtensions.Throws<ObjectDisposedException>(() => ObjectDisposedException.Throw(obj));
ObjectDisposedException ex = AssertExtensions.Throws<ObjectDisposedException>(
() => ObjectDisposedException.Throw(obj));

Assert.Equals("System.Object", ex.ObjectName);
}

[Fact]
public static void Throw_Type()
{
var type = new object().GetType();
AssertExtensions.Throws<ObjectDisposedException>(() => ObjectDisposedException.Throw(type));
Type type = new object().GetType();
ObjectDisposedException ex = AssertExtensions.Throws<ObjectDisposedException>(
() => ObjectDisposedException.Throw(type));

Assert.Equals("System.Object", ex.ObjectName);
}
}
}

0 comments on commit a260ea6

Please sign in to comment.