public void SetUp()
        {
            _returnType    = ReflectionObjectMother.GetSomeType();
            _parameterType = ReflectionObjectMother.GetSomeOtherType();

            _type = new DelegateTypePlaceholder(_returnType, new[] { _parameterType }.AsOneTime());
        }
Ejemplo n.º 2
0
        public void GetEmittableType_DelegateTypePlaceholder()
        {
            var mutableReturnType   = MutableTypeObjectMother.Create();
            var emittableReturnType = ReflectionObjectMother.GetSomeOtherType();

            _provider.AddMapping(mutableReturnType, emittableReturnType);
            _provider.AddMapping(_mutableType, _emittableType);
            var delegateTypePlaceholder = new DelegateTypePlaceholder(mutableReturnType, new[] { _mutableType });

            var fakeResult = ReflectionObjectMother.GetSomeDelegateType();

            _delegateProviderMock.Setup(mock => mock.GetDelegateType(mutableReturnType, new[] { _mutableType })).Returns(fakeResult).Verifiable();

            var result = _provider.GetEmittableType(delegateTypePlaceholder);

            Assert.That(result, Is.SameAs(fakeResult));
        }