Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. [RunWith("mockolate.runner.MockolateRunner")]
  2. public class LoginDelegateTest
  3. {
  4. [Mock]
  5. public var loginDelegate:LoginDelegate;
  6.  
  7. [Test]
  8. public function loginCommandDoesAToLower() : void {
  9.  
  10. var loginCommand:LoginCommand = new LoginCommand();
  11. loginCommand.loginDelegate = loginDelegate;
  12.  
  13. mock(loginDelegate).method("login").args("username", "password");
  14.  
  15. //loginCommand.execute("UserName", "PassWord");
  16.  
  17. verify(loginDelegate);
  18.  
  19. }
  20.  
  21. }
  22.  
  23. package
  24. {
  25. public class LoginCommand
  26. {
  27.  
  28. public var loginDelegate:LoginDelegate;
  29.  
  30. public function LoginCommand()
  31. {
  32. }
  33.  
  34. public function execute(username:String, password:String) : void {
  35.  
  36. username = username.toLowerCase();
  37. password = password.toLowerCase();
  38.  
  39. loginDelegate.login(username, password);
  40.  
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement