コード例 #1
0
ファイル: CommandTest.cs プロジェクト: Zazcallabah/Alchemist
        public void CommandCanAddRulesForEveryPossibleCombinationForAnElement()
        {
            ICommand command = new AddMultiComboCommand();

            Assert.IsTrue( command.AppliesTo( "*fire" ) );
        }
コード例 #2
0
ファイル: CommandTest.cs プロジェクト: Zazcallabah/Alchemist
        public void MultiCommandAddsRules()
        {
            ICommand command = new AddMultiComboCommand();
            var com = new TestCommunicator();
            var rs = new RuleSet()
            {
                FoundElements = new[] { new Element( "fire" ), new Element( "water" ) }
            };

            var c = new AlchemyController( rs );
            command.Run( "*fire", c, com );

            Assert.AreEqual( 2, rs.Rules.Length );
        }