Exemple #1
0
        public void Test_Add_User()
        {
            // Arrange
            var player = new BearPlayer.Bear_Player();

            player.clear_users();
            string name = "bob";

            // Act
            player.create_new_user(name);

            // Assert
            string[] users = player.get_all_users(player.get_all_user_lines());
            Assert.AreEqual(users[0], name);
        }
Exemple #2
0
        public void Test_Get_All_Users()
        {
            // Arrange
            var player = new BearPlayer.Bear_Player();

            player.clear_users();

            // Act
            player.create_new_user("dan");
            player.create_new_user("dan2");
            player.create_new_user("dan3");

            // Assert
            string[] users = player.get_all_users(player.get_all_user_lines());
            Assert.AreEqual(users.Length, 3);
        }
Exemple #3
0
        public void Test_Delete_Users()
        {
            // Arrange
            var player = new BearPlayer.Bear_Player();

            player.clear_users();

            // Act
            player.create_new_user("dan");
            player.create_new_user("dan2");
            player.create_new_user("dan3");
            player.clear_users();

            // Assert
            try
            {
                string[] users = player.get_all_users(player.get_all_user_lines());
                Assert.Fail();
            }
            catch (Exception e)
            {
                Assert.IsTrue(true);
            }
        }