Ejemplo n.º 1
0
        public void SetUp()
        {
            var serializableType   = ReflectionObjectMother.GetSomeSerializableType();
            var formatterConverter = new FormatterConverter();

            _info    = new SerializationInfo(serializableType, formatterConverter);
            _context = new StreamingContext((StreamingContextStates)7);

            _pipelineRegistryStub = MockRepository.GenerateStub <IPipelineRegistry>();
            Assert.That(PipelineRegistry.HasInstanceProvider, Is.False);
            PipelineRegistry.SetInstanceProvider(() => _pipelineRegistryStub);

            _deserializationMethodInvokerMock = MockRepository.GenerateMock <IDeserializationMethodInvoker>();
            _createRealObjectAssertions       = (instance, info, ctx, typeName) => { throw new Exception("Setup assertions and return real object."); };

            // Use testable class instead of partial mock, because RhinoMocks chokes on non-virtual ISerializable.GetObjectData.
            _objectDeserializationProxyBase = new TestableObjectDeserializationProxyBase(
                _info,
                _context,
                (instance, info, ctx, typeName) => _createRealObjectAssertions(instance, info, ctx, typeName));

            PrivateInvoke.SetNonPublicField(_objectDeserializationProxyBase, "_deserializationMethodInvoker", _deserializationMethodInvokerMock);
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            Assert.That(PipelineRegistry.HasInstanceProvider, Is.False);

            _registry = MockRepository.GenerateStub <IPipelineRegistry>();
        }
Ejemplo n.º 3
0
        public void SetUp()
        {
            Assert.That(PipelineRegistry.HasInstanceProvider, Is.False);

            _registry = new Mock <IPipelineRegistry>().Object;
        }
Ejemplo n.º 4
0
 public ObjectFactoryImplementation(IPipelineRegistry pipelineRegistry)
 {
     ArgumentUtility.CheckNotNull("pipelineRegistry", pipelineRegistry);
     _pipelineRegistry = pipelineRegistry;
 }
Ejemplo n.º 5
0
        public DomainObjectCreator(IPipelineRegistry pipelineRegistry)
        {
            ArgumentUtility.CheckNotNull("pipelineRegistry", pipelineRegistry);

            _pipelineRegistry = pipelineRegistry;
        }