public void CallBase_StaticContext()
 {
     Assert.That(
         () => _staticContext.CallBase(ReflectionObjectMother.GetSomeInstanceMethod()),
         Throws.InvalidOperationException
         .With.Message.EqualTo(
             "Cannot perform base call from static method."));
 }
        public void Initialization_InstanceMethodRequiresTarget()
        {
            var method = ReflectionObjectMother.GetSomeInstanceMethod();

            Assert.That(
                () => new NewDelegateExpression(typeof(Action), null, method),
                Throws.ArgumentException
                .With.ArgumentExceptionMessageEqualTo(
                    "Instance method requires target.", "target"));
        }
Beispiel #3
0
        public void SetUp()
        {
            _serializableFieldFinderMock = MockRepository.GenerateStrictMock <ISerializableFieldFinder>();

            _enabler = new ProxySerializationEnabler(_serializableFieldFinderMock);

            _someProxy                    = MutableTypeObjectMother.Create(typeof(SomeType));
            _serializableProxy            = MutableTypeObjectMother.Create(typeof(SomeType), attributes: TypeAttributes.Serializable);
            _serializableInterfaceProxy   = MutableTypeObjectMother.Create(typeof(SerializableInterfaceType), copyCtorsFromBase: true);
            _deserializationCallbackProxy = MutableTypeObjectMother.Create(typeof(DeserializationCallbackType));
            _serializableInterfaceWithDeserializationCallbackProxy =
                MutableTypeObjectMother.Create(baseType: typeof(SerializableWithDeserializationCallbackType), attributes: TypeAttributes.Serializable);

            _someInitializationMethod = ReflectionObjectMother.GetSomeInstanceMethod();
        }
Beispiel #4
0
        public void Initialization_InstanceMethodRequiresTarget()
        {
            var method = ReflectionObjectMother.GetSomeInstanceMethod();

            new NewDelegateExpression(typeof(Action), null, method);
        }
 public void CallBase_StaticContext()
 {
     _staticContext.CallBase(ReflectionObjectMother.GetSomeInstanceMethod());
 }