예제 #1
0
 public void TestAreAssignableSymmetrical(Type a, Type b)
 {
     Assert.AreEqual(
         TypeHelper.AreAssignable(a.GetTypeInfo(), b.GetTypeInfo(), out Type abCommon),
         TypeHelper.AreAssignable(b.GetTypeInfo(), a.GetTypeInfo(), out Type baCommon)
         );
     Assert.AreEqual(abCommon, baCommon);
 }
예제 #2
0
 public void TestAreAssignable(Type a, Type b, Type expectedAssignment)
 {
     if (expectedAssignment == null)
     {
         Assert.IsFalse(TypeHelper.AreAssignable(a.GetTypeInfo(), b.GetTypeInfo(), out _));
     }
     else
     {
         Assert.IsTrue(TypeHelper.AreAssignable(a.GetTypeInfo(), b.GetTypeInfo(), out Type common));
         Assert.AreEqual(expectedAssignment, common);
     }
 }