예제 #1
0
        public void GetValidatedType_CollectorWithoutGenericArgument()
        {
            _decoratedResolverMock.Expect(mock => mock.GetValidatedType(typeof(IComponentValidationCollector))).Return(typeof(string));

            var result = _resolver.GetValidatedType(typeof(IComponentValidationCollector));

            _decoratedResolverMock.VerifyAllExpectations();
            Assert.That(result, Is.EqualTo(typeof(string)));
        }
예제 #2
0
        public void GetValidatedType_CollectorWithoutApplyWithMixinAttribute()
        {
            var collectorTypeWithApplyWithClassAttribute = typeof(PersonValidationCollector1);

            _decoratedResolverMock.Expect(mock => mock.GetValidatedType(collectorTypeWithApplyWithClassAttribute)).Return(typeof(Person));

            var result = _resolver.GetValidatedType(collectorTypeWithApplyWithClassAttribute);

            _decoratedResolverMock.VerifyAllExpectations();
            Assert.That(result, Is.EqualTo(typeof(Person)));
        }