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())); }
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())); }
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())); }
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); }