Ejemplo n.º 1
0
        public void PassingWrongParameterNamesThrowsException_01()
        {
            FormationRule formationRule = new FormationRule();

            formationRule.parameters.Add(new FormationRuleParameter("nonrelevantTag", "nonrelevantValue"));
            RelativeToPlayerHorizontallyAdapter relativePlayerAdapter = new RelativeToPlayerHorizontallyAdapter();

            Assert.Throws <FormationException>(() => relativePlayerAdapter.GetPlacementRule(formationRule, new PlacedFormation()));
        }
Ejemplo n.º 2
0
        public void PassingNonexistentTagThrowsException()
        {
            FormationRule formationRule = new FormationRule();

            formationRule.parameters.Add(new FormationRuleParameter("playerRelative", "X"));
            formationRule.parameters.Add(new FormationRuleParameter("relativeType", "Inside"));
            formationRule.parameters.Add(new FormationRuleParameter("distance", "7"));
            RelativeToPlayerHorizontallyAdapter relativePlayerAdapter = new RelativeToPlayerHorizontallyAdapter();

            Assert.Throws <PlacedFormationException>(() => relativePlayerAdapter.GetPlacementRule(formationRule, new PlacedFormation()));
        }
Ejemplo n.º 3
0
        public void PassingGoodParametersInDoesntThrowException()
        {
            FormationRule formationRule = new FormationRule();

            formationRule.parameters.Add(new FormationRuleParameter("playerRelative", "X"));
            formationRule.parameters.Add(new FormationRuleParameter("relativeType", "Inside"));
            formationRule.parameters.Add(new FormationRuleParameter("distance", "7"));
            RelativeToPlayerHorizontallyAdapter relativePlayerAdapter = new RelativeToPlayerHorizontallyAdapter();
            PlacedFormation placedFormation = new PlacedFormation();

            placedFormation.skillPlayers[1].tag = "X";

            relativePlayerAdapter.GetPlacementRule(formationRule, placedFormation);
        }