public void DeserializeExtraRelationshipTest()
        {
            // Arrange
            var modelManager = new ModelManager(new PluralizationService());
            modelManager.RegisterResourceType(typeof(Author));
            var formatter = new JsonApiFormatter(modelManager);
            MemoryStream stream = new MemoryStream();

            stream = new MemoryStream(System.Text.Encoding.ASCII.GetBytes(@"{""data"":{""id"":13,""type"":""authors"",""attributes"":{""name"":""Jason Hater""},""relationships"":{""posts"":{""data"":[]},""bogus"":{""data"":[]}}}}"));

            // Act
            Author a;
            a = (Author)formatter.ReadFromStreamAsync(typeof(Author), stream, (System.Net.Http.HttpContent)null, (System.Net.Http.Formatting.IFormatterLogger)null).Result;

            // Assert
            Assert.AreEqual("Jason Hater", a.Name); // Completed without exceptions and didn't timeout!
        }
        public void SetupModels()
        {
            a = new Author
            {
                Id = 1,
                Name = "Jason Hater",
            };

            t1 = new Tag 
            {
                Id = 1,
                Text = "Ember"
            };
            t2 = new Tag 
            {
                Id = 2,
                Text = "React"
            };
            t3 = new Tag 
            {
                Id = 3,
                Text = "Angular"
            };

            p = new Post()
            {
                Id = 1,
                Title = "Linkbait!",
                Author = a
            };
            p2 = new Post
            {
                Id = 2,
                Title = "Rant #1023",
                Author = a
            };
            p3 = new Post
            {
                Id = 3,
                Title = "Polemic in E-flat minor #824",
                Author = a
            };
            p4 = new Post
            {
                Id = 4,
                Title = "This post has no author."
            };

            a.Posts = new List<Post> { p, p2, p3 };

            p.Comments = new List<Comment>() {
                new Comment() {
                    Id = 2,
                    Body = "Nuh uh!",
                    Post = p
                },
                new Comment() {
                    Id = 3,
                    Body = "Yeah huh!",
                    Post = p
                },
                new Comment() {
                    Id = 4,
                    Body = "Third Reich.",
                    Post = p,
                    CustomData = "{ \"foo\": \"bar\" }"
                }
            };
            p2.Comments = new List<Comment> {
                new Comment {
                    Id = 5,
                    Body = "I laughed, I cried!",
                    Post = p2
                }
            };

            s1 = new Sample
            {
                Id = "1",
                BooleanField = false,
                NullableBooleanField = false,
                SByteField = default(SByte),
                NullableSByteField = null,
                ByteField = default(Byte),
                NullableByteField = null,
                Int16Field = default(Int16),
                NullableInt16Field = null,
                UInt16Field = default(UInt16),
                NullableUInt16Field = null,
                Int32Field = default(Int32),
                NullableInt32Field = null,
                UInt32Field = default(Int32),
                NullableUInt32Field = null,
                Int64Field = default(Int64),
                NullableInt64Field = null,
                UInt64Field = default(UInt64),
                NullableUInt64Field = null,
                DoubleField = default(Double),
                NullableDoubleField = null,
                SingleField = default(Single),
                NullableSingleField = null,
                DecimalField = default(Decimal),
                NullableDecimalField = null,
                DateTimeField = default(DateTime),
                NullableDateTimeField = null,
                DateTimeOffsetField = default(DateTimeOffset),
                NullableDateTimeOffsetField = null,
                GuidField = default(Guid),
                NullableGuidField = null,
                StringField = default(String),
                EnumField = default(SampleEnum),
                NullableEnumField = null,
            };
            s2 = new Sample
            {
                Id = "2",
                BooleanField = true,
                NullableBooleanField = true,
                SByteField = 123,
                NullableSByteField = 123,
                ByteField = 253,
                NullableByteField = 253,
                Int16Field = 32000,
                NullableInt16Field = 32000,
                UInt16Field = 64000,
                NullableUInt16Field = 64000,
                Int32Field = 2000000000,
                NullableInt32Field = 2000000000,
                UInt32Field = 3000000000,
                NullableUInt32Field = 3000000000,
                Int64Field = 9223372036854775807,
                NullableInt64Field = 9223372036854775807,
                UInt64Field = 9223372036854775808,
                NullableUInt64Field = 9223372036854775808,
                DoubleField = 1056789.123,
                NullableDoubleField = 1056789.123,
                SingleField = 1056789.123f,
                NullableSingleField = 1056789.123f,
                DecimalField = 1056789.123m,
                NullableDecimalField = 1056789.123m,
                DateTimeField = new DateTime(1776, 07, 04),
                NullableDateTimeField = new DateTime(1776, 07, 04),
                DateTimeOffsetField = new DateTimeOffset(new DateTime(1776, 07, 04), new TimeSpan(-5, 0, 0)),
                NullableDateTimeOffsetField = new DateTimeOffset(new DateTime(1776, 07, 04), new TimeSpan(-5, 0, 0)),
                GuidField = new Guid("6566F9B4-5245-40DE-890D-98B40A4AD656"),
                NullableGuidField = new Guid("3D1FB81E-43EE-4D04-AF91-C8A326341293"),
                StringField = "Some string 156",
                EnumField = SampleEnum.Value1,
                NullableEnumField = SampleEnum.Value2,
            };
        }