public void CovarianceAndContravariance() { var obj = new UnrelatedType9().ToContract<IVariance<string, object>>(); Assert.AreEqual("A", obj.VariantMethod("A")); Assert.IsTrue(new MyClass().Satisfies<IStringToObject>()); }
public void Invariance() { var obj = new UnrelatedType9().ToContract<IVariance<object, string>>(); Assert.AreEqual("A", obj.VariantMethod("A")); Assert.IsTrue(new MyClass().Satisfies<IObjectToString>()); }