Skip to content

Commit

Permalink
Add tests for IDynamicInterfaceCastable
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwalchadha committed Sep 24, 2020
1 parent ba117da commit 1cb8c01
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions UnitTest/TestComponentCSharp_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,23 @@ public class TestCSharp
public TestCSharp()
{
TestObject = new Class();
}

#if NET5_0
[Fact]
public void TestDynamicInterfaceCastingOnValidInterface()
{
var agileObject = (IAgileObject)(IWinRTObject)TestObject;
Assert.NotNull(agileObject);
}

[Fact]
public void TestDynamicInterfaceCastingOnInvalidInterface()
{
Assert.ThrowsAny<System.Exception>(() => (IStringableInterop)(IWinRTObject)TestObject);
}
#endif

[Fact]
public void TestUri()
{
Expand Down

0 comments on commit 1cb8c01

Please sign in to comment.