Ejemplo n.º 1
0
        public void CannotCreateMatchBetForMatchThatIsOngoing()
        {
            SystemTimeMocker.SetOneSecondAfter(firstMatch.StartDateTime);

            MatchBet matchBet = MatchBet.Create(better, firstMatch, firstMatch.Player1);

            matchBet.Should().BeNull();
        }
Ejemplo n.º 2
0
        public void CanCreateMatchBet()
        {
            MatchBet matchBet = MatchBet.Create(better, firstMatch, firstMatch.Player1);

            matchBet.Should().NotBeNull();
            matchBet.Id.Should().NotBeEmpty();
            matchBet.BetterId.Should().Be(better.Id);
            matchBet.MatchId.Should().Be(firstMatch.Id);
            matchBet.PlayerId.Should().Be(firstMatch.Player1.Id);
        }
Ejemplo n.º 3
0
        public void CannotCreateMatchBetForMatchThatIsFinished()
        {
            SystemTimeMocker.SetOneSecondAfter(firstMatch.StartDateTime);

            int winningScore = (int)Math.Ceiling(firstMatch.BestOf / 2.0);

            firstMatch.Player1.IncreaseScore(winningScore);

            MatchBet matchBet = MatchBet.Create(better, firstMatch, firstMatch.Player1);

            matchBet.Should().BeNull();
        }
Ejemplo n.º 4
0
        public void CannotCreateMatchBetWithoutPlayer()
        {
            MatchBet matchBet = MatchBet.Create(better, firstMatch, null);

            matchBet.Should().BeNull();
        }
Ejemplo n.º 5
0
        public void CannotCreateMatchBetWithoutBetter()
        {
            MatchBet matchBet = MatchBet.Create(null, firstMatch, firstMatch.Player1);

            matchBet.Should().BeNull();
        }