예제 #1
0
    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);
    }
예제 #2
0
    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);
    }
예제 #3
0
    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");
    }