Beispiel #1
0
        public void TestJudgeRound()
        {
            List <JudgeRound> ret = WeblParser.ParseJudges(_judgeString, "Test B 0001", "ZZTest B 0001");
            List <JudgeRound> rev = WeblParser.ParseJudges(_judgeString, "ZZTest B 0001", "Test B 0001");

            Debug.Print("Got it");
        }
Beispiel #2
0
        public void GetCutList_EmptyTest()
        {
            string  text = "Test B 0001 remains standing while the trainer wipes him down.";
            CutList c    = WeblParser.GetCutList("Test B 0001", text);

            Assert.AreEqual(0, c.Count);
        }
Beispiel #3
0
        public void ParseDamageTest()
        {
            Round rr = new Round(1, new FighterRound(null), new FighterRound(null));

            string text = @"
Test B 0001:

Your fighter lost 14.1 points of endurance this round due to damage, and 4.0 points due to fatigue. He took 12.1 points of stun damage this round. He has accumulated 67 points of damage in the fight.

ZZTest B 0001:

Your fighter lost 11.4 points of endurance this round due to damage, and 4.0 points due to fatigue. He took 11.4 points of stun damage this round. He has accumulated 69 points of damage in the fight. ";


            WeblParser.ParseDamage(rr, text);
            Assert.AreEqual(14.1, rr.Fighter1Round.DamageReceived.EnduranceDamage);
            Assert.AreEqual(12.1, rr.Fighter1Round.DamageReceived.StunDamage);
            Assert.AreEqual(11.4, rr.Fighter2Round.DamageReceived.EnduranceDamage);
            Assert.AreEqual(11.4, rr.Fighter2Round.DamageReceived.StunDamage);
            Assert.AreEqual(14.1, rr.Fighter2Round.DamageDealt.EnduranceDamage);
            Assert.AreEqual(12.1, rr.Fighter2Round.DamageDealt.StunDamage);

            Assert.AreEqual(4.0, rr.Fighter1Round.FatigueEndRound);
            Assert.AreEqual(4.0, rr.Fighter2Round.FatigueEndRound);
        }
Beispiel #4
0
        public void ParseFightTest()
        {
            Fight fpr = WeblParser.ParseFight(_fullThing);


            Assert.AreEqual(FightOutcome.Win, fpr.Result.Outcome);
            Assert.AreEqual(FightResultType.Knockout, fpr.Result.ResultType);
        }
Beispiel #5
0
        public void GetTacticsTest()
        {
            string text = "Your tactics: aggressiveness = 1.0, power = 1.0, defense = 8.0, resting 10.0";

            FighterTactics expected = new FighterTactics(1.0, 1.0, 8.0, 10.0);
            FighterTactics actual   = WeblParser.GetTactics(text);

            Assert.AreEqual(expected, actual);
        }
Beispiel #6
0
        public void GetCutListTest()
        {
            string text = "Here's a line before it" + Environment.NewLine +
                          "Test B 0001 remains standing while the trainer wipes him down. He has his left eye badly swollen. He has a fractured nose." +
                          Environment.NewLine + "Here's a line after";
            CutList c = WeblParser.GetCutList("Test B 0001", text);

            Assert.AreEqual(2, c.Count);
            Assert.IsTrue(c.Count(d => d.Type == CutType.SwellLeft && d.Level == CutSeverity.Medium) == 1);
            Assert.IsTrue(c.Count(d => d.Type == CutType.InjuredNose && d.Level == CutSeverity.Medium) == 1);
        }
Beispiel #7
0
        public void GetFightingStyleTest()
        {
            string text = "SOme guy is being bad man (clinching).";

            FightingStyle expected = FightingStyle.Clinch;
            FightingStyle actual   = WeblParser.GetFightingStyle(text, "SOme guy");

            Assert.AreEqual(expected, actual);

            text = _clinchRound;

            Round rr = WeblParser.ParseWeblRound(text);

            Assert.AreEqual(FightingStyle.Clinch, rr.Fighter1Round.Tactics.Style);
        }
Beispiel #8
0
 public bool  ParseIt()
 {
     try
     {
         _parseResult          = WeblParser.ParseFight(this.ParseText);
         _parseResult.Fighter1 = new FighterStats(Shared.Locator().Fighter1.SelectedFighter);
         _parseResult.Fighter2 = new FighterStats(Shared.Locator().Fighter2.SelectedFighter);
         foreach (Round res in _parseResult.RoundResults)
         {
             res.Fighter1Round.SetPercentages(Shared.Locator().Fighter1.SelectedFighter.Conditioning * 10);
             res.Fighter2Round.SetPercentages(Shared.Locator().Fighter2.SelectedFighter.Conditioning * 10);
         }
         List <RoundReportOld> roundReports = _parseResult.RoundResults.Select(f => new RoundReportOld(f)).ToList();
         Shared.Locator().FightResults.SetResults(_parseResult);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
         return(false);
     }
     return(true);
 }
Beispiel #9
0
        public void TestDQRound()
        {
            Round rr = WeblParser.ParseWeblRound(_dqRound);

            Assert.AreEqual(FightResultType.DQ, rr.ResultType);
        }
Beispiel #10
0
        public void TestTKORound()
        {
            Round rr = WeblParser.ParseWeblRound(_tkoRound);

            Assert.AreEqual(FightResultType.TKO, rr.ResultType);
        }
Beispiel #11
0
        public void TestKORound()
        {
            Round rr = WeblParser.ParseWeblRound(_koRound);

            Assert.AreEqual(FightResultType.Knockout, rr.ResultType);
        }
Beispiel #12
0
        public void ParseWeblRoundTest()
        {
            Round rr = WeblParser.ParseWeblRound(_roundText);

            Debug.Print("Hey");
        }
        private void SetDesignData()
        {
            Fight fight = WeblParser.ParseFight(_bigString);

            SetResults(fight);
        }