コード例 #1
0
    public void leftBoundryTest()
    {
        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.Left();
        Assert.AreEqual(1, 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);
    }