public void GenericContract() { var value = new UnrelatedType5().ToContract<ICastableTo<int>>(); Assert.AreEqual(1, value.Cast()); }
public void ImplicitConversionOperator() { var value = new UnrelatedType5().ToContract<IConvertibleToFloat>(); Assert.AreEqual(2.5f, value.ToFloat()); }
public void Overloads() { var value = new UnrelatedType5().ToContract<ITwoMethods>(); value.Value(); Assert.AreEqual(10, value.Value(1, 2, "", 3, 4, "")); }
public void ExplicitConversionOperator() { var value = new UnrelatedType5().ToContract<ICastableToInt32>(); Assert.AreEqual(1, value.ToInt32()); }
public void ParameterizedContract() { var value = new UnrelatedType5().ToContract<IParameterizedMethod>(); Assert.AreEqual(6, value.Value(1, 2, "", 1, 2, "")); }