示例#1
0
        public void AddCreator_NoCreatorIF_Test()
        {
            // Arrange
            ComponentCreators target = new ComponentCreators();

            // Act
            TU.ExecuteExcectedException <QuillException>(
                () => target.Create(typeof(IComponentCreator)));
        }
示例#2
0
        public void Create_ArgumentComponent_Test()
        {
            // Arrange
            ComponentCreators target = new ComponentCreators();

            // Act
            TU.ExecuteExcectedException <QuillException>(
                () => target.Create(typeof(ArgumentConstructorComponent)));
        }
示例#3
0
        public void Create_ComponentTypeNull_Test()
        {
            // Arrange
            ComponentCreators target = new ComponentCreators();

            // Act
            TU.ExecuteExcectedException <ArgumentNullException>(
                () => target.Create(null));
        }
示例#4
0
        public void Create_Default_Test()
        {
            // Arrange
            ComponentCreators target = new ComponentCreators();

            // Act
            var actual = target.Create(typeof(NormalComponent)) as NormalComponent;

            // Assert
            Assert.IsNotNull(actual);
        }
示例#5
0
        public void AddCreatorTest()
        {
            // Arrange
            ComponentCreators target = new ComponentCreators();

            target.AddCreator(typeof(IComponentCreator), t => new ComponentCreators());

            // Act
            var actual = target.Create(typeof(IComponentCreator)) as IComponentCreator;

            // Assert
            Assert.IsNotNull(actual);
        }