public Login ( string userName, string password ) : Task |
||
userName | string | User name. |
password | string | User's password. |
return | Task |
public async Task Login_CreatesNewAuthKey(UserSyncanoClient client) { //when var result = await client.Login(TestData.UserName, TestData.UserPassword); //then result.ShouldNotBeNull(); }
public async Task Login_WithNullPassword_CreatesNewAuthKey(UserSyncanoClient client) { try { await client.Login("userName", null); throw new Exception("Login should throw an exception."); } catch (Exception e) { //then e.ShouldBeType<ArgumentNullException>(); } }
public async Task Login_WithInvalidPasswordOverHttp_ThrowsException() { //given var httpClient = new UserSyncanoClient(new SyncanoHttpClient(TestData.InstanceName, TestData.UserApiKey)); try { //when await httpClient.Login(TestData.UserName, "abcde"); throw new Exception("Login should throw an exception."); } catch (Exception e) { //then e.ShouldBeType<SyncanoException>(); } }
public async Task Login_WithInvalidName_CreatesNewAuthKey(UserSyncanoClient client) { try { await client.Login("abcde", TestData.UserPassword); throw new Exception("Login should throw an exception."); } catch (Exception e) { //then e.ShouldBeType<SyncanoException>(); } }
public async Task Update_NoUserId_UpdatesUserObject_OverHttp() { //given var httpClient = new UserSyncanoClient(new SyncanoHttpClient(TestData.InstanceName, TestData.UserApiKey)); await httpClient.Login(TestData.UserName, TestData.UserPassword); //when var user = await httpClient.Update(currentPassword: TestData.UserPassword); //then user.Name.ShouldEqual(TestData.UserName); }
public async Task GetOne_GetsUserObject_OverHttp() { //given var httpClient = new UserSyncanoClient(new SyncanoHttpClient(TestData.InstanceName, TestData.UserApiKey)); await httpClient.Login(TestData.UserName, TestData.UserPassword); //when var result = await httpClient.GetOne(userName:TestData.UserName); //then result.ShouldNotBeNull(); }