Advertisement
Guest User

Untitled

a guest
Feb 1st, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1.  
  2. [
  3. undefined, null, ''
  4. ].forEach((username: string) => {
  5. it('RegisterAsync with invalid username shouldn\'t call Register API service', async () => {
  6. // Arrange
  7. let spy: jasmine.Spy = spyOn(http, 'put');
  8.  
  9. // Act
  10. try {
  11. await authService.RegisterAsync(username, '12345Aqwe!@#');
  12. } catch (e) {
  13. }
  14.  
  15. // Assert
  16. expect(spy).not.toHaveBeenCalled();
  17. });
  18. });
  19.  
  20. [
  21. undefined, null, ''
  22. ].forEach((password: string) => {
  23. it('RegisterAsync with invalid password shouldn\'t call Register API service', async () => {
  24. // Arrange
  25. let spy: jasmine.Spy = spyOn(http, 'put');
  26.  
  27. // Act
  28. try {
  29. await authService.RegisterAsync('username', password);
  30. } catch (e) {
  31. }
  32.  
  33. // Assert
  34. expect(spy).not.toHaveBeenCalled();
  35. });
  36. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement