public void WriteObjectInline_Writes_RequestCount()
        {
            // Arrange
            ODataSerializer customerSerializer = new StubODataSerializer(ODataPayloadKind.Entry);
            ODataSerializerProvider provider = new FakeODataSerializerProvider(customerSerializer);
            var mockWriter = new Mock<ODataWriter>();

            long expectedCount = 12345;
            _writeContext.InlineCount = expectedCount;

            mockWriter
                .Setup(m => m.WriteStart(It.IsAny<ODataFeed>()))
                .Callback((ODataFeed feed) =>
                {
                    Assert.Equal(expectedCount, feed.Count);
                });
            _serializer = new ODataFeedSerializer(_customersType, provider);

            // Act
            _serializer.WriteObjectInline(_customers, mockWriter.Object, _writeContext);

            // Assert
            mockWriter.Verify();
        }
        public void WriteObjectInline_Writes_RequestNextPageLink()
        {
            // Arrange
            ODataSerializer customerSerializer = new StubODataSerializer(ODataPayloadKind.Entry);
            ODataSerializerProvider provider = new FakeODataSerializerProvider(customerSerializer);
            var mockWriter = new Mock<ODataWriter>();

            Uri expectedNextLink = new Uri("http://nextlink.com");
            _writeContext.NextPageLink = expectedNextLink;

            ODataFeed actualFeed = null;
            mockWriter
                .Setup(m => m.WriteStart(It.IsAny<ODataFeed>()))
                .Callback((ODataFeed feed) =>
                {
                    actualFeed = feed;
                });
            _serializer = new ODataFeedSerializer(_customersType, provider);

            // Act
            _serializer.WriteObjectInline(_customers, mockWriter.Object, _writeContext);

            // Assert
            Assert.Equal(expectedNextLink, actualFeed.NextPageLink);
        }