public void MarkAsComplete_AlreadyComplete_ThrowsException() { var repo = new Mock <IBetRepository>(); var bookie = new BookMaker(repo.Object); var completedOutcome = new BetOption() { Id = 1, Bet = new Bet() { Id = 1, Complete = true } }; Assert.Throws <Exception>(() => bookie.MarkAsComplete(completedOutcome, ValidBettor)); }
public void MarkAsComplete_Valid_MarksBetAsComplete_AndAddsPoints() { var repo = new Mock <IBetRepository>(); var bookie = new BookMaker(repo.Object); var outcome = new BetOption() { Id = 1, Bet = new Bet() { Id = 1 } }; bookie.MarkAsComplete(outcome, ValidBettor); repo.Verify(m => m.MarkComplete(It.IsAny <Bet>(), It.IsAny <Bettor>())); repo.Verify(m => m.MarkCorrect(It.IsAny <BetOption>())); repo.Verify(m => m.AddPointsToSuccessfulGuess(It.IsAny <BetOption>(), It.IsAny <long>())); }
public void MarkAsComplete_DefaultBettor_ThrowsArgumentException() { var bookie = new BookMaker(); Assert.Throws <ArgumentException>(() => bookie.MarkAsComplete(ValidBetOption, new Bettor())); }
public void MarkAsComplete_NullBettor_ThrowsNullException() { var bookie = new BookMaker(); Assert.Throws <ArgumentNullException>(() => bookie.MarkAsComplete(ValidBetOption, null)); }