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. } } }
public void DeleteTopic() { string topicId = "testTopicForDeleteTopic" + _pubsubFixture.RandomName(); _pubsubFixture.CreateTopic(topicId); _deleteTopicSample.DeleteTopic(_pubsubFixture.ProjectId, topicId); Exception ex = Assert.Throws <Grpc.Core.RpcException>(() => _pubsubFixture.GetTopic(topicId)); _pubsubFixture.TempTopicIds.Remove(topicId); // We already deleted it. }
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); } }