public void LookupGeneric()
        {
            var result = _assistant
                         .Lookup(typeof(ISampleGenericContract <int>))
                         .ToArray()
            ;

            Assert.Single(result);
        }
Beispiel #2
0
        public void Lookup_ExistingGeneric_ReturnsValid()
        {
            var assistant = new ReflectionCache();

            assistant.AddTypes(GetType().Assembly);
            assistant.Prepare();

            var actual = assistant
                         .Lookup(typeof(ISampleGenericContract <int>))
                         .ToArray()
            ;

            Assert.Single(actual);
            Assert.Equal(typeof(SampleInstance), actual.Single());
        }
Beispiel #3
0
        public void Lookup_ValidatorForSpecificType_ReturnsValidatorForContract()
        {
            var assistant = new ReflectionCache();

            assistant.AddTypes(GetType().Assembly);
            assistant.Prepare();

            var actual = assistant
                         .Lookup(typeof(IValidator <ValidatedRequest>))
                         .ToArray()
            ;

            Assert.Single(actual);
            Assert.Equal(typeof(SomeValidator), actual.Single());
        }