public void DeleteSchema()
    {
        string schemaId = "testSchemaForDeleteSchema" + _pubsubFixture.RandomName();

        _pubsubFixture.CreateAvroSchema(schemaId);
        _deleteSchemaSample.DeleteSchema(_pubsubFixture.ProjectId, schemaId);

        Exception ex = Assert.Throws <Grpc.Core.RpcException>(() => _pubsubFixture.GetSchema(schemaId));

        _pubsubFixture.TempSchemaIds.Remove(schemaId);  // We already deleted it.
    }
Beispiel #2
0
    public void Dispose()
    {
        var deleteTopicSampleObject        = new DeleteTopicSample();
        var deleteSubscriptionSampleObject = new DeleteSubscriptionSample();
        var deleteSchemaSampleObject       = new DeleteSchemaSample();

        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.
            }
        }
        foreach (string schemaId in TempSchemaIds)
        {
            try
            {
                deleteSchemaSampleObject.DeleteSchema(ProjectId, schemaId);
            }
            catch (RpcException)
            {
                // Do nothing, we are deleting on a best effort basis.
            }
        }
    }