public void rightBoundryTest() { var mockAvatarBehaviour = new Mock<IAvatarBehaviour>(); var mockUserInput = new Mock<IUserInput>(); Avatar av = new Avatar(mockAvatarBehaviour.Object, mockUserInput.Object); av.Right(); Assert.AreEqual(3, av.Track); av.Right(); Assert.AreEqual(3, av.Track); }
public void avatarMovementTest() { var mockAvatarBehaviour = new Mock<IAvatarBehaviour>(); var mockUserInput = new Mock<IUserInput>(); Avatar av = new Avatar(mockAvatarBehaviour.Object, mockUserInput.Object); av.Left(); Assert.AreEqual(1, av.Track); av.Right(); Assert.AreEqual(2, av.Track); av.Right(); Assert.AreEqual(3, av.Track); av.Left(); Assert.AreEqual(2, av.Track); }
public void moveDeadAvatarTest() { // Arrange var mockAvatarBehaviour = new Mock<IAvatarBehaviour>(); var mockUserInput = new Mock<IUserInput>(); Avatar av = new Avatar( mockAvatarBehaviour.Object, mockUserInput.Object ); StateManager.Instance.Die(); // Act av.Right(); // Assert Assert.AreEqual(av.Track, 2, "A dead avatar should be able to move"); }