Exemplo n.º 1
0
        public void WhenPartitionProviderThenCreatesUntypedWrapper()
        {
            // arrange
            var message = new SomeMessage();

            var partitionProviderMock = new Mock <Func <SomeMessage, string, int> >();

            partitionProviderMock.Setup(x => x(message, "topic1")).Returns(1);

            // act
            _pb.PartitionProvider(partitionProviderMock.Object);

            // assert
            var partitionProvider = _ps.GetPartitionProvider();

            partitionProvider(message, "topic1").Should().Be(1);
            partitionProviderMock.Verify(x => x(message, "topic1"), Times.Once);
        }