Beispiel #1
0
    public void Dispose()
    {
        var deleteTopicSampleObject        = new DeleteTopicSample();
        var deleteSubscriptionSampleObject = new DeleteSubscriptionSample();

        foreach (string subscriptionId in TempSubscriptionIds)
        {
            try
            {
                deleteSubscriptionSampleObject.DeleteSubscription(ProjectId, subscriptionId);
            }
            catch (RpcException)
            {
                // Do nothing, we are deleting on a best effort basis.
            }
        }
        foreach (string topicId in TempTopicIds)
        {
            try
            {
                deleteTopicSampleObject.DeleteTopic(ProjectId, topicId);
            }
            catch (RpcException)
            {
                // Do nothing, we are deleting on a best effort basis.
            }
        }
    }
Beispiel #2
0
    public void Dispose()
    {
        var deleteTopicSampleObject        = new DeleteTopicSample();
        var deleteSubscriptionSampleObject = new DeleteSubscriptionSample();

        foreach (string subscriptionId in TempSubscriptionIds)
        {
            deleteSubscriptionSampleObject.DeleteSubscription(ProjectId, subscriptionId);
        }
        foreach (string topicId in TempTopicIds)
        {
            deleteTopicSampleObject.DeleteTopic(ProjectId, topicId);
        }
    }
Beispiel #3
0
    public void TestDeleteSubscription()
    {
        string topicId        = "testTopicForDeleteSubscription" + _pubsubFixture.RandomName();
        string subscriptionId = "testSubscriptionForDeleteSubscription" + _pubsubFixture.RandomName();

        _pubsubFixture.CreateTopic(topicId);
        _pubsubFixture.CreateSubscription(topicId, subscriptionId);

        _deleteSubscriptionSample.DeleteSubscription(_pubsubFixture.ProjectId, subscriptionId);

        Exception e = Assert.Throws <Grpc.Core.RpcException>(() => _pubsubFixture.GetSubscription(subscriptionId));

        _pubsubFixture.TempSubscriptionIds.Remove(subscriptionId);  // We already deleted it.
    }