/// <summary>
        /// Fabricate a result by multiplying the input by 2
        /// </summary>
        /// <param name="note">notification the <c>INotification</c> carrying the <c>MacroCommandTestVO</c></param>
        public override void Execute(INotification note)
        {
            MacroCommandTestVO vo = (MacroCommandTestVO)note.Body;

            // Fabricate a result
            vo.Result1 = 2 * vo.Input;
        }
Exemplo n.º 2
0
        public void TestMacroCommandExecute()
        {
            // Create the VO
            var vo = new MacroCommandTestVO(5);

            // Create the Notification (notification)
            INotification note = new Notification("MacroCommandTest", vo);

            // Create the SimpleCommand
            ICommand command = new MacroCommandTestCommand();

            // Execute the SimpleCommand
            command.Execute(note);

            // test assertions
            Assert.IsTrue(vo.Result1 == 10, "Expecting vo.Result1 == 10");
            Assert.IsTrue(vo.Result2 == 25, "Expecting vo.Result2 == 25");
        }