Esempio n. 1
0
        public void When_building_a_closed_generic_repository_and_no_implementations_are_present_ArgumentException_is_thrown()
        {
            var importDefinitionType = typeof(IRepository <Order>);
            var implementations      = new List <Type>();

            Assert.That(() =>
            {
                TypeHelper.BuildGenericTypes(importDefinitionType, implementations);
            }, Throws.InstanceOf <ArgumentException>());
        }
Esempio n. 2
0
        public void When_building_a_closed_generic_repository_Order_repository_is_returned()
        {
            var importDefinitionType = typeof(IRepository <Order>);
            var implementations      = new List <Type>
            {
                typeof(Repository <>)
            };
            var orderRepositoryTypes = TypeHelper.BuildGenericTypes(importDefinitionType, implementations);

            Assert.AreEqual(typeof(Repository <Order>), orderRepositoryTypes.Single());
        }