public void GetEncoder_should_return_encoder()
        {
            var mockEncoder = Substitute.For<IMessageEncoder<KillCursorsMessage>>();
            var mockEncoderFactory = Substitute.For<IMessageEncoderFactory>();
            mockEncoderFactory.GetKillCursorsMessageEncoder().Returns(mockEncoder);

            var subject = new KillCursorsMessage(_requestId, _cursorIds);
            var encoder = subject.GetEncoder(mockEncoderFactory);
            encoder.Should().BeSameAs(mockEncoder);
        }
Ejemplo n.º 2
0
        public void GetEncoder_should_return_encoder()
        {
            var subject = new KillCursorsMessage(_requestId, _cursorIds);
            var mockEncoderFactory = new Mock<IMessageEncoderFactory>();
            var encoder = new Mock<IMessageEncoder>().Object;
            mockEncoderFactory.Setup(f => f.GetKillCursorsMessageEncoder()).Returns(encoder);

            var result = subject.GetEncoder(mockEncoderFactory.Object);

            result.Should().BeSameAs(encoder);
        }
        public void GetEncoder_should_return_encoder()
        {
            var subject = new KillCursorsMessage(_requestId, _cursorIds);
            var stubEncoderFactory = Substitute.For<IMessageEncoderFactory>();
            var stubEncoder = Substitute.For<IMessageEncoder>();
            stubEncoderFactory.GetKillCursorsMessageEncoder().Returns(stubEncoder);

            var result = subject.GetEncoder(stubEncoderFactory);

            result.Should().BeSameAs(stubEncoder);
        }
Ejemplo n.º 4
0
        public void GetEncoder_should_return_encoder()
        {
            var subject            = new KillCursorsMessage(_requestId, _cursorIds);
            var stubEncoderFactory = Substitute.For <IMessageEncoderFactory>();
            var stubEncoder        = Substitute.For <IMessageEncoder>();

            stubEncoderFactory.GetKillCursorsMessageEncoder().Returns(stubEncoder);

            var result = subject.GetEncoder(stubEncoderFactory);

            result.Should().BeSameAs(stubEncoder);
        }
        public void GetEncoder_should_return_encoder()
        {
            var subject            = new KillCursorsMessage(_requestId, _cursorIds);
            var mockEncoderFactory = new Mock <IMessageEncoderFactory>();
            var encoder            = new Mock <IMessageEncoder>().Object;

            mockEncoderFactory.Setup(f => f.GetKillCursorsMessageEncoder()).Returns(encoder);

            var result = subject.GetEncoder(mockEncoderFactory.Object);

            result.Should().BeSameAs(encoder);
        }
        public void GetEncoder_should_return_encoder()
        {
            var mockEncoder        = Substitute.For <IMessageEncoder <KillCursorsMessage> >();
            var mockEncoderFactory = Substitute.For <IMessageEncoderFactory>();

            mockEncoderFactory.GetKillCursorsMessageEncoder().Returns(mockEncoder);

            var subject = new KillCursorsMessage(_requestId, _cursorIds);
            var encoder = subject.GetEncoder(mockEncoderFactory);

            encoder.Should().BeSameAs(mockEncoder);
        }