Ejemplo n.º 1
0
        public void DepartNonJoined()
        {
            var user = new UserInfo("Nickname", "Phonetic", "Username", 1, 2, true);

            var manager = new ClientUserManager();

            Assert.IsFalse(manager.GetIsJoined(user));
            Assert.IsFalse(manager.Depart(user));
        }
Ejemplo n.º 2
0
        public void ExtensionGetIsJoinedUsername()
        {
            var user  = new UserInfo("Nickname", "Phonetic", "Username", 1, 2, true);
            var user2 = new UserInfo("Nickname2", "Phonetic", "Username2", 2, 3, false);

            var manager = new ClientUserManager();

            manager.Join(user);

            Assert.IsTrue(manager.GetIsJoined(user));
            Assert.IsFalse(manager.GetIsJoined(user2));

            manager.Join(user2);
            Assert.IsTrue(manager.GetIsJoined(user2));

            manager.Depart(user);
            Assert.IsFalse(manager.GetIsJoined(user));
        }
Ejemplo n.º 3
0
        public void Depart()
        {
            var user = new UserInfo("Nickname", "Phonetic", "Username", 1, 2, true);

            var manager = new ClientUserManager();

            manager.Join(user);

            Assert.IsTrue(manager.GetIsJoined(user));
            Assert.IsTrue(((IEnumerable <IUserInfo>)manager).Contains(user));
            Assert.AreEqual(user, manager[user.UserId]);

            Assert.IsTrue(manager.Depart(user));

            Assert.IsFalse(manager.GetIsJoined(user));
            Assert.IsFalse(((IEnumerable <IUserInfo>)manager).Contains(user));
            Assert.AreEqual(null, manager[user.UserId]);
        }
Ejemplo n.º 4
0
        public void DepartNullUser()
        {
            var manager = new ClientUserManager();

            Assert.Throws <ArgumentNullException> (() => manager.Depart(null));
        }