public async Task Get_GetsApiKeysList(ApiKeySyncanoClient client) { //when var result = await client.Get(); //then result.ShouldNotBeNull(); result.Count.ShouldEqual(2); result.Any(a => a.ApiKeyValue == TestData.BackendAdminApiKey).ShouldBeTrue(); }
public async Task New_WithRoleIdAndUserType_ThrowsException(ApiKeySyncanoClient client) { try { //when await client.New("description", ApiKeyType.User, TestData.RoleId); throw new Exception("New should throw an exception"); } catch (Exception e) { //then e.ShouldBeType <ArgumentException>(); } }
public async Task New_WithInvalidRoleId_ThrowsException(ApiKeySyncanoClient client) { try { //when await client.New("description", ApiKeyType.Backend, "9999"); throw new Exception("New should throw an exception"); } catch (Exception e) { //then e.ShouldBeType <SyncanoException>(); } }
public async Task New_WithNullDescription_ThrowsException(ApiKeySyncanoClient client) { try { //when await client.New(null, roleId : TestData.RoleId); throw new Exception("New should throw an exception"); } catch (Exception e) { //then e.ShouldBeType <ArgumentNullException>(); } }