Beispiel #1
0
        public void ShouldCreateCommandFactory()
        {
            // Arrange
            var reflectionWrapperMock = new Mock <IReflection>();

            // Act
            var commandFactory = ObjectModel.CreateCommandFactory(reflectionWrapperMock.Object);

            // Assert
            Assert.IsNotNull(commandFactory);
            Assert.IsNotNull(commandFactory.Commands);

            var commands = commandFactory.Commands.ToArray();

            Assert.IsTrue(commands.Length > 0);
            Assert.IsTrue(commands.Any(x => x is BuildStrategy));
            Assert.IsTrue(commands.Any(x => x is CleanStrategy));
            Assert.IsTrue(commands.Any(x => x is DeployStrategy));
            Assert.IsTrue(commands.Any(x => x is GenerateStrategy));
            Assert.IsTrue(commands.Any(x => x is HelloStrategy));
            Assert.IsTrue(commands.Any(x => x is HelpStrategy <ObjectModel>));
            Assert.IsTrue(commands.Any(x => x is ImportStrategy));
            Assert.IsTrue(commands.Any(x => x is NewStrategy));
            Assert.IsTrue(commands.Any(x => x is PublishStrategy));
            Assert.IsTrue(commands.Any(x => x is ReferenceStrategy));
            Assert.IsTrue(commands.Any(x => x is SlnStrategy));
            Assert.IsTrue(commands.Any(x => x is VersionStrategy));
        }