Пример #1
0
 public void CastingWillSkipModulesWhichAreNotValidTargetsForTheCast()
 {
     var inner = new DisposableObject();
     dynamic value = new DelegatingObject( inner, new DelegatingObject() );
     IDisposable instance = value;
     Assert.AreSame( instance, inner );
 }
Пример #2
0
 public void CastingToAModulesBaseClassWillResolveAndCastThatModule()
 {
     var outer = new Cat();
     dynamic value = new DelegatingObject( DateTime.Now, outer, 10 );
     Animal animal = value;
     Assert.AreSame( outer, animal );
 }
Пример #3
0
 public void CastingToABaseClassWithADelegatingObjectInTheModuleChainCastsSuccessfully()
 {
     var outer = new Cat();
     dynamic value = new DelegatingObject( outer, new DelegatingObject() );
     Animal animal = value;
     Assert.AreSame( outer, animal );
 }
Пример #4
0
 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() );
 }
Пример #7
0
 public virtual void Setup()
 {
     Value = Create();
 }
Пример #8
0
 public void TestingChainOfModules()
 {
     dynamic value = new DelegatingObject( 5, "cat", 10, new Uri( "http://www.foo.com" ) );
     Assert.AreEqual( 3, value.Length );
 }
Пример #9
0
 public override void Setup()
 {
     Value = new DelegatingObject( new ProtoTypalObjectWithMethods() );
 }
Пример #10
0
 public void CanCastToModuleWhenOnlyASingleModuleIsSupplied()
 {
     dynamic value = new DelegatingObject( new DisposableObject() );
     IDisposable instance = value;
     Assert.IsNotNull( instance );
 }