Example #1
0
    public void TestMagicNormalCast()
    {
        PlayerTestClass player = new PlayerTestClass();
        int             magic  = player.getMagic();

        player.modifyMagic(-1);
        magic = player.getMagic();
        Assert.AreEqual(magic, 9);
    }
Example #2
0
    public void TestMagicCanNotGoOverTen()
    {
        PlayerTestClass player = new PlayerTestClass();
        int             magic  = player.getMagic();

        magic = player.modifyMagic(1);
        Assert.AreEqual(magic, 10);
        Assert.AreEqual(player.getMagic(), 10);
    }
Example #3
0
    public void TestOrbPickupAtZeroMagic()
    {
        PlayerTestClass player = new PlayerTestClass();
        int             magic  = player.getMagic();

        magic = player.modifyMagic(-10);
        Assert.AreEqual(player.getMagic(), 0);
        player.modifyMagic(1);
        Assert.AreEqual(player.getMagic(), 1);
    }
Example #4
0
    public void TestMagicCanNotGoBelowZero()
    {
        PlayerTestClass player = new PlayerTestClass();
        int             magic  = player.getMagic();

        magic = player.modifyMagic(-10);
        Assert.AreEqual(magic, 0);
        Assert.AreEqual(player.getMagic(), 0);
        magic = player.modifyMagic(-2);
        Assert.AreEqual(magic, -1);
        Assert.AreEqual(player.getMagic(), 0);
    }
Example #5
0
    public void TestPlayerCtor()
    {
        PlayerTestClass player = new PlayerTestClass();

        Assert.AreEqual(100, player.getHealth());
        Assert.AreEqual(10, player.getMagic());
        Assert.IsTrue(player.alive);
    }