Пример #1
0
        public void WillNotAddMultipleTypes()
        {
            Compose <IAnimal> .Exports.Clear();

            //Register
            Compose <IAnimal> .Add(typeof(Lion));

            Compose <IAnimal> .Add(typeof(Lion));

            //Act
            var animals = Compose <IAnimal> .GetAll();

            // Assert
            Assert.True(animals.Count == 1 && animals.First().GetType() == typeof(Lion));
        }
Пример #2
0
        public void CanGetAllExports()
        {
            Compose <IAnimal> .Exports.Clear();

            //Register
            Compose <IAnimal> .Add(typeof(Lion));

            Compose <IAnimal> .Add(typeof(Dog));

            Compose <IAnimal> .Add(typeof(Cat));

            //Act
            var animals = Compose <IAnimal> .GetAll();

            // Assert
            Assert.True(animals.Count == 3);
        }