public void Connection_Connect_Behaviour_DisconnectUnconnectedUser() { User dummy = new User() { Name = "Crash Test Dummy", Password = "******" }; PieServiceClient pieService = new PieServiceClient(); pieService.Disconnect(dummy); //It's okay to disconnect a user even if he isn't connected }
public void Connection_Disconnect_Parameter_UserWithNullPassword() { User user = new User() { Name = "Crash Test Dummy", Password = "******" }; PieServiceClient pieService = new PieServiceClient(); pieService.Connect(user); user.Password = null; try { pieService.Disconnect(user); Assert.Fail("Was able to disconnect a user with a null-password"); } catch (Exception e) { if (!e.Message.Contains("Invalid string for username or password")) Assert.Fail(e.Message); } }
public void Connection_Disconnect_Parameter_UserWithEmptyPassword() { User dummy = new User() { Name = "Crash Test Dummy", Password = "" }; PieServiceClient pieService = new PieServiceClient(); try { pieService.Disconnect(dummy); } catch (Exception) { //This is good } }
public void Connection_Disconnect_Parameter_UserWithEmptyName() { User dummy = new User() { Name = "", Password = "******" }; PieServiceClient pieService = new PieServiceClient(); try { pieService.Disconnect(dummy); Assert.Fail("Was able to disconnect a user with an empty username"); } catch (Exception e) { if (!e.Message.Contains("Invalid string for username or password - user is not disconnected")) Assert.Fail(e.Message); } }
public void Connection_Disconnect_Parameter_User() { User user = new User() { Name = "Crash Test Dummy", Password = "******" }; PieServiceClient pieService = new PieServiceClient(); pieService.Connect(user); pieService.Disconnect(user); }
public void Connection_Disconnect_Parameter_Null() { PieServiceClient pieService = new PieServiceClient(); try { pieService.Disconnect(null); Assert.Fail("Was able to disconnect a null-user"); } catch (Exception e) { if (!e.Message.Contains("User is null")) Assert.Fail(e.Message); } }
public void Connection_Disconnect_Behaviour_DisconnectTwice() { User dummy = new User() { Name = "Crash Test Dummy", Password = "******" }; PieServiceClient pieService = new PieServiceClient(); pieService.Connect(dummy); pieService.Disconnect(dummy); pieService.Disconnect(dummy); }