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); }
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); } }