Exemplo n.º 1
0
        public void CreateTopicsResponse(
            [Values(
                 ErrorResponseCode.None,
                 ErrorResponseCode.InvalidTopic,
                 ErrorResponseCode.InvalidPartitions
                 )] ErrorResponseCode errorCode,
            [Values("test", "anotherNameForATopic")] string topicName,
            [Range(1, 11)] int count)
        {
            var topics = new TopicsResponse.Topic[count];

            for (var t = 0; t < count; t++)
            {
                topics[t] = new TopicsResponse.Topic(topicName + t, errorCode);
            }
            var response = new CreateTopicsResponse(topics);

            response.AssertCanEncodeDecodeResponse(0);
        }
Exemplo n.º 2
0
        public void CreateTopicsResponse(
            [Values(
                 ErrorCode.NONE,
                 ErrorCode.INVALID_TOPIC_EXCEPTION,
                 ErrorCode.INVALID_PARTITIONS
                 )] ErrorCode errorCode,
            [Values("test", "anotherNameForATopic")] string topicName,
            [Range(1, 11)] int count)
        {
            var topics = new TopicsResponse.Topic[count];

            for (var t = 0; t < count; t++)
            {
                topics[t] = new TopicsResponse.Topic(topicName + t, errorCode);
            }
            var response = new CreateTopicsResponse(topics);

            response.AssertCanEncodeDecodeResponse(0);
        }