public void ParseAcceptHeader_InvalidTokenAtEnd()
        {
            // Arrange
            var expected = new MediaTypeSegmentWithQuality[0];

            var input = "*/*:";

            // Act
            var parsed = AcceptHeaderParser.ParseAcceptHeader(new List <string>()
            {
                input
            });

            // Assert
            expected.Should().Equal(parsed);
        }
        public void ParseAcceptHeader_DelimiterAtStart()
        {
            // Arrange
            var expected = new MediaTypeSegmentWithQuality[0];

            var input = ",;:";

            // Act
            var parsed = AcceptHeaderParser.ParseAcceptHeader(new List <string>()
            {
                input
            });

            // Assert
            expected.Should().Equal(parsed);
        }
        public void ParseAcceptHeader_ValidMediaType_FollowedBySemicolon()
        {
            // Arrange
            var expected = new MediaTypeSegmentWithQuality[0];

            var input = "*/*Content-Type;application/json";

            // Act
            var parsed = AcceptHeaderParser.ParseAcceptHeader(new List <string>()
            {
                input
            });

            // Assert
            expected.Should().Equal(parsed);
        }
        public void ParseAcceptHeader_ValidMediaType_FollowedByWhitespace()
        {
            // Arrange
            var expected = new MediaTypeSegmentWithQuality[]
            {
                new MediaTypeSegmentWithQuality(new StringSegment("application/json"), 1.0),
            };

            var input = "*/*Content-Type application/json";

            // Act
            var parsed = AcceptHeaderParser.ParseAcceptHeader(new List <string>()
            {
                input
            });

            // Assert
            expected.Should().Equal(parsed);
        }