public void PassingNoCorrectColorsReturnsEmptyResults() { var expected = new PinResult[] { }; var computerPinColors = new[] { PinColor.Blue, PinColor.Blue, PinColor.Blue, PinColor.Blue }; var userPinColors = new[] { PinColor.Red, PinColor.Red, PinColor.Red, PinColor.Red }; var sut = new Mastermind(computerPinColors); var result = sut.Check(userPinColors); Assert.Equal(expected, result); }
public void PassingAllCorrectColorsInCorrectOrderReturnsAllBlack() { var expected = new[] { PinResult.Black, PinResult.Black, PinResult.Black, PinResult.Black }; var computerPinColors = new[] { PinColor.Blue, PinColor.Green, PinColor.Red, PinColor.White }; var userPinColors = new[] { PinColor.Blue, PinColor.Green, PinColor.Red, PinColor.White }; var sut = new Mastermind(computerPinColors); var result = sut.Check(userPinColors); Assert.Equal(expected, result); }
public void PassingOneCorrectColorsInCorrectPositionReturnsOneBlackPeg() { var expected = new[] { PinResult.Black }; var computerPinColors = new[] { PinColor.Blue, PinColor.Blue, PinColor.Blue, PinColor.Blue }; var userPinColors = new[] { PinColor.Blue, PinColor.Red, PinColor.Red, PinColor.Red }; var sut = new Mastermind(computerPinColors); var result = sut.Check(userPinColors); Assert.Equal(expected, result); }
private static void Assert(Mastermind sut, IReadOnlyCollection <string> readOnlyCollection, IEnumerable <PinResult> pinResults) { var result1 = sut.Check(readOnlyCollection); Xunit.Assert.Equal(pinResults, result1); }