示例#1
0
    public void SetUsername()
    {
        Level level = new Level {
            LevelIndex = 1
        };
        string username = "******";

        toplist.SetLocalUsername(username);
        toplist.Get(level, (entries) =>
        {
            bool found = false;
            foreach (var entry in entries)
            {
                found |= entry.Username == username;
            }

            Assert.AreEqual(found, true);
        });
    }
示例#2
0
    public void ToplistContainsUsername()
    {
        const string username = "******";

        toplist.SetLocalUsername(username);

        Level level = new Level {
            LevelIndex = 1
        };
        var score = 1000;

        toplist.ReportResult(level, score);

        toplist.Get(level, (entries) => {
            bool found = false;
            foreach (var entry in entries)
            {
                found |= entry.Username == username;
            }

            Assert.AreEqual(found, true);
        });
    }