public void Play_4_Sides_Winner_Determined() { //Arrange var anotherMatch = new Mock <IPlayMatch>(); playMatches.Add(anotherMatch.Object); target = new PlayTournament(playMatches); var winner = new Mock <ISide>(); winner.SetupProperty <int>(w => w.Strength, 33); playMatch.Setup <ISide>(m => m.Play()).Returns(winner.Object); anotherMatch.Setup <ISide>(m => m.Play()).Returns(winner.Object); //Act ISide result = target.Play(); //Assert Assert.IsNotNull(result); Assert.AreEqual(winner.Object, result); playMatch.Verify(m => m.Play(), Times.Exactly(1)); Assert.AreEqual(3, target.GetMatchScores().Count()); }
public void Setup() { playMatch = new Mock<IPlayMatch>(); playMatches = new List<IPlayMatch>(); playMatches.Add(playMatch.Object); target = new PlayTournament(playMatches); }
public void Setup() { playMatch = new Mock <IPlayMatch>(); playMatches = new List <IPlayMatch>(); playMatches.Add(playMatch.Object); target = new PlayTournament(playMatches); }
public void Constructor_Empty_Sides_Contract_Checked() { //Arrange var matches = new List<IPlayMatch>(); //Act target = new PlayTournament(matches); }
public void Constructor_Empty_Sides_Contract_Checked() { //Arrange var matches = new List <IPlayMatch>(); //Act target = new PlayTournament(matches); }
public void Play_2_Sides_Winner_Determined() { //Arrange target = new PlayTournament(playMatches); var winner = new Mock<ISide>(); playMatch.Setup<ISide>(m => m.Play()).Returns(winner.Object); //Act var result = target.Play(); //Assert Assert.IsNotNull(result); Assert.AreEqual(winner.Object, result); playMatch.Verify(m => m.Play(), Times.AtMostOnce()); Assert.AreEqual(1, target.GetMatchScores().Count()); }
public void Play_2_Sides_Winner_Determined() { //Arrange target = new PlayTournament(playMatches); var winner = new Mock <ISide>(); playMatch.Setup <ISide>(m => m.Play()).Returns(winner.Object); //Act var result = target.Play(); //Assert Assert.IsNotNull(result); Assert.AreEqual(winner.Object, result); playMatch.Verify(m => m.Play(), Times.AtMostOnce()); Assert.AreEqual(1, target.GetMatchScores().Count()); }
public void Play_4_Sides_Winner_Determined() { //Arrange var anotherMatch = new Mock<IPlayMatch>(); playMatches.Add(anotherMatch.Object); target = new PlayTournament(playMatches); var winner = new Mock<ISide>(); winner.SetupProperty<int>(w => w.Strength, 33); playMatch.Setup<ISide>(m => m.Play()).Returns(winner.Object); anotherMatch.Setup<ISide>(m => m.Play()).Returns(winner.Object); //Act ISide result = target.Play(); //Assert Assert.IsNotNull(result); Assert.AreEqual(winner.Object, result); playMatch.Verify(m => m.Play(), Times.Exactly(1)); Assert.AreEqual(3, target.GetMatchScores().Count()); }
public void TearDown() { playMatch.VerifyAll(); target = null; }
public void Constructor_Null_Sides_Contract_Checked() { //Act target = new PlayTournament(null); }