Esempio n. 1
0
        static void Main(string[] args)
        {
            // Commands allow execution of different actions
            HelloWorldCommand cmd = new HelloWorldCommand();

            cmd.Execute();

            // To pause and read the result
            Console.ReadKey();
        }
Esempio n. 2
0
        public void Execute_HelloWorldCommand_ErrorCodeEquals3()
        {
            // Arrange
            double expected = 3;

            OptionObject2015       optionObject2015      = new OptionObject2015();
            IOptionObjectDecorator optionObjectDecorator = new OptionObjectDecorator(optionObject2015);
            var command = new HelloWorldCommand(optionObjectDecorator);

            // Act
            var actual = command.Execute();

            // Assert
            Assert.AreEqual(expected, actual.ErrorCode);
        }
Esempio n. 3
0
        public void Execute_HelloWorldCommand_ReturnsOptionObject2015()
        {
            // Arrange
            OptionObject2015 expected = new OptionObject2015();

            OptionObject2015       optionObject2015      = new OptionObject2015();
            IOptionObjectDecorator optionObjectDecorator = new OptionObjectDecorator(optionObject2015);
            var command = new HelloWorldCommand(optionObjectDecorator);

            // Act
            var actual = command.Execute();

            // Assert
            Assert.AreEqual(expected.GetType(), actual.GetType());
        }