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); } }
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); }
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); }
public void Test_Switch_To_User() { // 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 Assert.AreEqual(player.get_user(), "dan3"); player.switch_to_user("dan2"); Assert.AreEqual(player.get_user(), "dan2"); Assert.AreEqual(player.switch_to_user("not_a_user"), false); }