public void TestDeuceAfterAdvantageBis() { ServiceMatch target = new ServiceMatch(); List <IMatchEvent> events = new List <IMatchEvent>() { new MatchStarted("p1", "p2"), new MatchPoint("p1"), new MatchPoint("p2"), new MatchPoint("p1"), new MatchPoint("p2"), new MatchPoint("p1"), new MatchPoint("p2"), new MatchPoint("p1"), new MatchPoint("p2"), new MatchPoint("p1"), new MatchPoint("p2") }; Match actual = target.Replay(events); Assert.AreEqual(actual.Score[0], 3); Assert.AreEqual(actual.Score[1], 3); Assert.AreEqual(actual.Deuce, true); Assert.AreEqual(actual.AdvantagePlayer, string.Empty); }
public void TestGameAfterOneDeuceAdvantage() { ServiceMatch target = new ServiceMatch(); List <IMatchEvent> events = new List <IMatchEvent>() { new MatchStarted("p1", "p2"), new MatchPoint("p1"), new MatchPoint("p2"), new MatchPoint("p1"), new MatchPoint("p2"), new MatchPoint("p1"), new MatchPoint("p2"), new MatchPoint("p1"), new MatchPoint("p2"), new MatchPoint("p1"), new MatchPoint("p1") }; Match actual = target.Replay(events); Assert.AreEqual(actual.Score[0], 0); Assert.AreEqual(actual.Score[1], 0); Assert.AreEqual(actual.Score[2], 1); Assert.AreEqual(actual.Score[3], 0); }
public void TestMatchStart() { ServiceMatch target = new ServiceMatch(); List <IMatchEvent> events = new List <IMatchEvent>() { new MatchStarted("p1", "p2"), }; Match actual = target.Replay(events); }
public void TestPoint() { ServiceMatch target = new ServiceMatch(); List <IMatchEvent> events = new List <IMatchEvent>() { new MatchStarted("p1", "p2"), new MatchPoint("p1"), }; Match actual = target.Replay(events); Assert.AreEqual(actual.Score[0], 1); Assert.AreEqual(actual.Score[1], 0); }
public void TestAdvantage() { ServiceMatch target = new ServiceMatch(); List <IMatchEvent> events = new List <IMatchEvent>() { new MatchStarted("p1", "p2"), new MatchPoint("p1"), new MatchPoint("p2"), new MatchPoint("p1"), new MatchPoint("p2"), new MatchPoint("p1"), new MatchPoint("p2"), new MatchPoint("p1") }; Match actual = target.Replay(events); Assert.AreEqual(actual.Score[0], 3); Assert.AreEqual(actual.Score[1], 3); Assert.AreEqual(actual.Deuce, false); Assert.AreEqual(actual.AdvantagePlayer, "p1"); }