public void ItemBoundMismatchLengthTest_ShouldThrowInvalidOperation()
        {
            var expected = new ItemBoundLengthClass {
                Items = new List <string>(new[] { "abc", "defghi" })
            };

            Roundtrip(expected);
        }
        public void ItemBoundMismatchLengthTest_ShouldThrowInvalidOperation()
        {
            var expected = new ItemBoundLengthClass {
                Items = new List <string>(new[] { "abc", "defghi" })
            };

#if TESTASYNC
            Assert.Throws <AggregateException>(() => Roundtrip(expected));
#else
            Assert.Throws <InvalidOperationException>(() => Roundtrip(expected));
#endif
        }
        public void ItemBoundLengthTest()
        {
            var expected = new ItemBoundLengthClass {
                Items = new List <string>(new[] { "abc", "def", "ghi" })
            };

            var itemLength     = expected.Items[0].Length;
            var expectedLength = sizeof(int) + itemLength * expected.Items.Count;
            var actual         = Roundtrip(expected, expectedLength);

            Assert.Equal(itemLength, actual.ItemLength);
            Assert.True(expected.Items.SequenceEqual(actual.Items));
        }