public void CastingWillSkipModulesWhichAreNotValidTargetsForTheCast() { var inner = new DisposableObject(); dynamic value = new DelegatingObject( inner, new DelegatingObject() ); IDisposable instance = value; Assert.AreSame( instance, inner ); }
public void CastingToAModulesBaseClassWillResolveAndCastThatModule() { var outer = new Cat(); dynamic value = new DelegatingObject( DateTime.Now, outer, 10 ); Animal animal = value; Assert.AreSame( outer, animal ); }
public void CastingToABaseClassWithADelegatingObjectInTheModuleChainCastsSuccessfully() { var outer = new Cat(); dynamic value = new DelegatingObject( outer, new DelegatingObject() ); Animal animal = value; Assert.AreSame( outer, animal ); }
public void CastingToAnInterfaceWhenThereIsAConflictBetweenModulesPrefersTheModuleThatWasLoadedLast() { var first = new DisposableObject(); var second = new DisposableObject(); dynamic value = new DelegatingObject( first, second ); IDisposable instance = value; Assert.AreSame( second, instance ); }
public override void Setup() { Value = new DelegatingObject( new ModuleWithMethods( new DelegatingObject() ) ); }
public override void Setup() { Value = new DelegatingObject( new DynamicObjectWithMethods() ); }
public virtual void Setup() { Value = Create(); }
public void TestingChainOfModules() { dynamic value = new DelegatingObject( 5, "cat", 10, new Uri( "http://www.foo.com" ) ); Assert.AreEqual( 3, value.Length ); }
public override void Setup() { Value = new DelegatingObject( new ProtoTypalObjectWithMethods() ); }
public void CanCastToModuleWhenOnlyASingleModuleIsSupplied() { dynamic value = new DelegatingObject( new DisposableObject() ); IDisposable instance = value; Assert.IsNotNull( instance ); }