public void DictionaryInterfaceNullMethodsTest() { dynamic tNew = new DynamicObjects.Dictionary(); ISimpleStringMethod tActsLike = ImpromptuInterface.Impromptu.ActLike(tNew); Assert.AreEqual(false, tActsLike.StartsWith("Te")); }
public void DynamiteyDictionaryNullMethodsTest() { dynamic tNew = new Dictionary(); ISimpleStringMethod tActsLike = Impromptu.ActLike <ISimpleStringMethod>(tNew); Assert.AreEqual(false, tActsLike.StartsWith("Te")); }
public void InterfaceDirectDuplicateTest() { dynamic tNew = new ExpandoObject(); tNew.StartsWith = new Func <string, bool>(x => true); ISimpleStringMethod tActsLike = Impromptu.ActLike <ISimpleStringMethod>(tNew, typeof(ISimpleStringMethod)); Assert.AreEqual(tNew.StartsWith("test"), tActsLike.StartsWith("test")); }
public void MethodCollisionTest() { dynamic tNew = new ExpandoObject(); tNew.StartsWith = new Func <string, bool>(x => true); ISimpleStringMethod tActsLike = Impromptu.ActLike <ISimpleStringMethod>(tNew, typeof(ISimpleStringMethodCollision)); Assert.AreEqual(tNew.StartsWith("test"), tActsLike.StartsWith("test")); dynamic tNew2 = new ExpandoObject(); tNew2.StartsWith = new Func <string, int>(x => 5); ISimpleStringMethodCollision tActsLike2 = Impromptu.ActLike <ISimpleStringMethod>(tNew2, typeof(ISimpleStringMethodCollision)); Assert.AreEqual(tNew2.StartsWith("test"), tActsLike2.StartsWith("test")); }
public void DictionaryCurriedAcctlikeNullMethodsTest() { ISimpleStringMethod tActsLike = Interfacing << new DynamicObjects.Dictionary(); Assert.AreEqual(false, tActsLike.StartsWith("Te")); }