public void SetTopicIamPolicy()
    {
        string topicId = "testTopicForSetTopicIamPolicy" + _pubsubFixture.RandomName();
        string testRoleValueToConfirm   = "pubsub.editor";
        string testMemberValueToConfirm = "group:[email protected]";

        _pubsubFixture.CreateTopic(topicId);

        var policy = _setTopicIamPolicySample.SetTopicIamPolicy(_pubsubFixture.ProjectId, topicId, testRoleValueToConfirm, testMemberValueToConfirm);

        Assert.Equal($"roles/{testRoleValueToConfirm}", policy.Bindings[0].Role);
        Assert.Contains(policy.Bindings[0].Members, c => c.Contains(testMemberValueToConfirm));
    }
Ejemplo n.º 2
0
    public void TopicIamPolicyPermissions()
    {
        string topicId = "testTopicForTestTopicIamPolicy" + _pubsubFixture.RandomName();
        string testRoleValueToConfirm   = "pubsub.editor";
        string testMemberValueToConfirm = "group:[email protected]";

        _pubsubFixture.CreateTopic(topicId);

        _setTopicIamPolicySample.SetTopicIamPolicy(_pubsubFixture.ProjectId, topicId, testRoleValueToConfirm, testMemberValueToConfirm);

        var response = _testTopicIamPermissionsSample.TestTopicIamPermissions(_pubsubFixture.ProjectId, topicId);

        Assert.NotEmpty(response.ToString());
    }