protected override void Context()
        {
            base.Context();
            _macroCommand             = A.Fake <IMacroCommand>();
            _macroCommand.Description = "_macroCommand";
            _macroCommand.Visible     = true;
            _subCommand1               = A.Fake <IMacroCommand>();
            _subCommand1.Description   = "_subCommand1";
            _subCommand2               = A.Fake <ICommand>();
            _subCommand2.Description   = "_subCommand2";
            _subCommand3               = A.Fake <ICommand>();
            _subCommand3.Description   = "_subCommand3";
            _subCommand1.Visible       = true;
            _subCommand2.Visible       = false;
            _subCommand3.Visible       = false;
            _subCommand11              = A.Fake <ICommand>();
            _subCommand11.Description  = "_subCommand11";
            _subCommand11.Visible      = false;
            _subCommand12              = A.Fake <IMacroCommand>();
            _subCommand12.Description  = "_subCommand12";
            _subCommand12.Visible      = true;
            _subCommand121             = A.Fake <ICommand>();
            _subCommand121.Description = "_subCommand121";
            _subCommand121.Visible     = false;
            _subCommand122             = A.Fake <ICommand>();
            _subCommand122.Description = "_subCommand122";
            _subCommand122.Visible     = true;
            _historyItem               = A.Fake <IHistoryItem>();

            A.CallTo(() => _historyItem.Command).Returns(_macroCommand);
            A.CallTo(() => _macroCommand.All()).Returns(new[] { _subCommand1, _subCommand2, _subCommand3 });
            A.CallTo(() => _subCommand1.All()).Returns(new[] { _subCommand11, _subCommand12 });
            A.CallTo(() => _subCommand12.All()).Returns(new[] { _subCommand121, _subCommand122 });
        }
        private CommandMetaData metaDataCommandFrom(IMacroCommand macroCommand)
        {
            var commandMetaData = new CommandMetaData {
                Discriminator = Constants.Serialization.MACRO_COMMAND
            };

            macroCommand.All().Each(childCommand => commandMetaData.AddCommand(MapFrom(childCommand)));
            return(commandMetaData);
        }
예제 #3
0
        public void the_returned_macro_command_should_contain_all_inverse_sub_command_in_the_accurate_order()
        {
            var subCommands = _result.All().ToList();

            subCommands.Count.ShouldBeEqualTo(3);
            subCommands[0].Id.IsInverseFor(_reversibleCommand3.Id).ShouldBeTrue();
            subCommands[1].Id.IsInverseFor(_reversibleCommand2.Id).ShouldBeTrue();
            subCommands[2].Id.IsInverseFor(_reversibleCommand1.Id).ShouldBeTrue();
        }
 protected override void Context()
 {
     base.Context();
     _historyItem          = A.Fake <IHistoryItem>();
     _macroCommand         = A.Fake <IMacroCommand>();
     _macroCommand.Visible = true;
     _subCommand1          = A.Fake <ICommand>();
     _subCommand2          = A.Fake <ICommand>();
     _subCommand3          = A.Fake <ICommand>();
     _subCommand1.Visible  = true;
     _subCommand2.Visible  = false;
     _subCommand3.Visible  = true;
     A.CallTo(() => _historyItem.Command).Returns(_macroCommand);
     A.CallTo(() => _macroCommand.All()).Returns(new[] { _subCommand1, _subCommand2, _subCommand3 });
 }
 public void the_macro_command_should_contain_the_added_commands()
 {
     _macroCommand.All().ShouldOnlyContainInOrder(_commandToAdd1, _commandToAdd2, _commandToAdd3);
 }
예제 #6
0
 public void should_ignore_any_label_commands()
 {
     _result.All().Count().ShouldBeEqualTo(2);
 }