public void Execute_WithValidHardLevel_ShouldCreateProperGame() { var mockReader = new MockIReader("medium"); this.mockingTool = new MockIContext(); this.mockingTool.MockContext.SetupGet(x => x.Reader).Returns(mockReader.MockReader.Object); this.command.Execute(this.mockingTool.MockContext.Object); Assert.AreEqual(GlobalConstants.MediumLevelCols, this.mockingTool.MockContext.Object.GameLogic.Game.Field.FieldCols); Assert.AreEqual(GlobalConstants.MediumLevelRows, this.mockingTool.MockContext.Object.GameLogic.Game.Field.FieldRows); }
public void Execute_WithInValidId_ShouldReturnTheSameGame() { var mockReader = new MockIReader("InvalidId"); var context = this.mockingTool.MockContext.Object; this.mockingTool.MockContext.SetupGet(x => x.Reader).Returns(mockReader.MockReader.Object); var expectedGame = context.GameLogic.Game; this.command.Execute(context); var actualGame = context.GameLogic.Game; Assert.AreEqual(expectedGame, actualGame); }