コード例 #1
0
    public void FieldManagerFlagTests()
    {
        // Use the Assert class to test conditions.
        FieldManager fm = new FieldManager();

        // Flags not set are false
        Assert.That(!fm.CheckFlag("foo"));

        // Flags set are true
        fm.SetFlag("foo");
        fm.SetFlag("bar");
        Assert.That(fm.CheckFlag("foo"));
        Assert.That(fm.CheckFlag("bar"));
        Assert.That(!fm.CheckFlag("baz"));

        // Flags unset become false
        fm.UnsetFlag("foo");
        Assert.That(!fm.CheckFlag("foo"));
        Assert.That(fm.CheckFlag("bar"));

        // Clear clears flags
        fm.ClearFlags();
        Assert.That(!fm.CheckFlag("bar"));
    }