예제 #1
0
    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);
    }
예제 #2
0
    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);
    }
예제 #3
0
    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);
    }
예제 #4
0
    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();
    }
예제 #5
0
    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);
    }