public void BuildModifyUsersRoleUrl_WithId_ReturnsExpectedUrl() { var id = "id"; var expectedResult = $"{ENDPOINT}/projects/{PROJECT_ID}/users/{id}/roles"; var actualResult = _builder.BuildModifyUsersRoleUrl(UserIdentifier.ById(id)); Assert.Equal(expectedResult, actualResult); }
public void BuildSubscriptionUserUrl_ById_ReturnsCorrectUrl() { var userIdentifier = UserIdentifier.ById(Guid.NewGuid().ToString()); var actualUrl = _builder.BuildSubscriptionUserUrl(userIdentifier); var expectedUrl = $"{ENDPOINT}/subscriptions/{SUBSCRIPTION_ID}/users/{userIdentifier.Id}"; Assert.Equal(expectedUrl, actualUrl); }
public async Task ModifyUsersRole_ById_ModifiesUserRoles() { var client = _fileSystemFixture.CreateMockClientWithResponse("ProjectUser.json"); var expected = _fileSystemFixture.GetExpectedResponse <UserModel>("ProjectUser.json"); var response = await client.ModifyUsersRolesAsync(UserIdentifier.ById(expected.Id), expected); response.Should().BeEquivalentTo(expected); }
public async void ActivateUser_ById_ActivatesUser() { var expected = _fileSystemFixture.GetExpectedResponse <SubscriptionUserModel>("User.json"); var identifier = UserIdentifier.ById(expected.Id); var client = _fileSystemFixture.CreateMockClientWithUrl(expectedUrl: $"{_subscriptionEndpoint}/users/{expected.Id}/activate"); Func <Task> activateUser = async() => await client.ActivateSubscriptionUserAsync(identifier); await activateUser.Should().NotThrowAsync(); }
public async Task GetSubscriptionUser_ById_GetsSubscriptionUser() { var expected = _fileSystemFixture.GetExpectedResponse <SubscriptionUserModel>("User.json"); var identifier = UserIdentifier.ById(expected.Id); var client = _fileSystemFixture.CreateMockClientWithResponse("User.json"); var response = await client.GetSubscriptionUserAsync(identifier); response.Should().BeEquivalentTo(expected); }