public void NotInTableCannotMove() { GetValidMockContextAndSettingWhichOnTable(out var mockContext, out var mockSettings); mockContext.Object.Position.X = mockSettings.Object.MinX - 1; //Make IsOnTable return false var service = new ToyRobotService(mockContext.Object, mockSettings.Object); var actual = service.CanMove(); Assert.IsFalse(actual); }
public void CanMoveWhenFacingWestButNotAtWestEdge() { GetValidMockContextAndSettingWhichOnTable(out var mockContext, out var mockSettings); mockContext.Object.Position.X = mockSettings.Object.MinX + 1; mockContext.Setup(mc => mc.Facing).Returns(Facing.West); var service = new ToyRobotService(mockContext.Object, mockSettings.Object); var actual = service.CanMove(); Assert.IsTrue(actual); }
public void CannotMoveWhenFacingEastAtEastEdge() { GetValidMockContextAndSettingWhichOnTable(out var mockContext, out var mockSettings); mockContext.Object.Position.X = mockSettings.Object.MaxX; mockContext.Setup(mc => mc.Facing).Returns(Facing.East); var service = new ToyRobotService(mockContext.Object, mockSettings.Object); var actual = service.CanMove(); Assert.IsFalse(actual); }