public void MustProcess_InboundEnvelopeWithNonKafkaEndpoint_FalseIsReturned()
        {
            var inboundEnvelope = new InboundEnvelope(
                new MemoryStream(),
                new List <MessageHeader>(),
                new TestOffset(),
                new SomeConsumerEndpoint("test"),
                string.Empty);

            var result = new KafkaGroupIdFilterAttribute().MustProcess(inboundEnvelope);

            result.Should().BeFalse();
        }
        public void MustProcess_InboundEnvelopesWithDifferentGroupId_ExpectedResultIsReturned(
            string envelopeGroupId,
            bool expectedResult)
        {
            var inboundEnvelope = new InboundEnvelope(
                new MemoryStream(),
                new List <MessageHeader>(),
                new TestOffset(),
                new KafkaConsumerEndpoint("my-topic")
            {
                Configuration = new KafkaConsumerConfig
                {
                    GroupId = envelopeGroupId
                }
            },
                "my-topic");

            var result = new KafkaGroupIdFilterAttribute("group1", "group2").MustProcess(inboundEnvelope);

            result.Should().Be(expectedResult);
        }
        public void MustProcess_NonInboundEnvelope_FalseIsReturned()
        {
            var result = new KafkaGroupIdFilterAttribute().MustProcess(new NoKeyMembersMessage());

            result.Should().BeFalse();
        }