Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- undefined, null, ''
- ].forEach((username: string) => {
- it('RegisterAsync with invalid username shouldn\'t call Register API service', async () => {
- // Arrange
- let spy: jasmine.Spy = spyOn(http, 'put');
- // Act
- try {
- await authService.RegisterAsync(username, '12345Aqwe!@#');
- } catch (e) {
- }
- // Assert
- expect(spy).not.toHaveBeenCalled();
- });
- });
- [
- undefined, null, ''
- ].forEach((password: string) => {
- it('RegisterAsync with invalid password shouldn\'t call Register API service', async () => {
- // Arrange
- let spy: jasmine.Spy = spyOn(http, 'put');
- // Act
- try {
- await authService.RegisterAsync('username', password);
- } catch (e) {
- }
- // Assert
- expect(spy).not.toHaveBeenCalled();
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement