Пример #1
0
    public void CreateTopic()
    {
        string topicId           = "testTopicForTopicCreation" + _pubsubFixture.RandomName();
        var    newlyCreatedTopic = _createTopicSample.CreateTopic(_pubsubFixture.ProjectId, topicId);

        _pubsubFixture.TempTopicIds.Add(topicId);
        var topic = _pubsubFixture.GetTopic(topicId);

        Assert.Equal(newlyCreatedTopic, topic);
    }
Пример #2
0
    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 CreateTopicWithSchema()
    {
        string schemaId = "testSchemaForTopicCreationWithSchema" + _pubsubFixture.RandomName();
        var    schema   = _pubsubFixture.CreateAvroSchema(schemaId);

        string topicId           = "testTopicForTopicCreationWithSchema" + _pubsubFixture.RandomName();
        var    newlyCreatedTopic = _createTopicWithSchemaSample.CreateTopicWithSchema(_pubsubFixture.ProjectId, topicId, schema.Name, Encoding.Json);

        _pubsubFixture.TempTopicIds.Add(topicId);
        var topic = _pubsubFixture.GetTopic(topicId);

        Assert.Equal(newlyCreatedTopic, topic);
    }