Пример #1
0
            public void PassingWrongParameterNamesThrowsException_03()
            {
                FormationRule formationRule = new FormationRule();

                formationRule.parameters.Add(new FormationRuleParameter("distanceBehind", "5"));
                BehindPlayerAdapter behindPlayerAdapter = new BehindPlayerAdapter();

                Assert.Throws <FormationException>(() => behindPlayerAdapter.GetPlacementRule(formationRule, new PlacedFormation()));
            }
Пример #2
0
            public void PassingWrongParameterNamesThrowsException_01()
            {
                FormationRule formationRule = new FormationRule();

                formationRule.parameters.Add(new FormationRuleParameter("nonrelevantTag", "nonrelevantValue"));
                BehindPlayerAdapter behindPlayerAdapter = new BehindPlayerAdapter();

                Assert.Throws <FormationException>(() => behindPlayerAdapter.GetPlacementRule(formationRule, new PlacedFormation()));
            }
Пример #3
0
            public void PassingNonexistentTagThrowsException()
            {
                FormationRule formationRule = new FormationRule();

                formationRule.parameters.Add(new FormationRuleParameter("playerBehindTag", "RG"));
                formationRule.parameters.Add(new FormationRuleParameter("distanceBehind", "12"));
                BehindPlayerAdapter behindPlayerAdapter = new BehindPlayerAdapter();

                Assert.Throws <PlacedFormationException>(() => behindPlayerAdapter.GetPlacementRule(formationRule, new PlacedFormation()));
            }
Пример #4
0
            public void PassingGoodParametersInDoesntThrowException()
            {
                FormationRule formationRule = new FormationRule();

                formationRule.parameters.Add(new FormationRuleParameter("playerBehindTag", "RG"));
                formationRule.parameters.Add(new FormationRuleParameter("distanceBehind", "12"));
                BehindPlayerAdapter behindPlayerAdapter = new BehindPlayerAdapter();
                PlacedFormation     placedFormation     = new PlacedFormation();

                placedFormation.rightGuard.tag = "RG";

                behindPlayerAdapter.GetPlacementRule(formationRule, placedFormation);
            }