public void EmptyCollectionLengthTest() { var expected = new BoundLengthClass <List <string> > { Field = new List <string>() }; var actual = Roundtrip(expected); Assert.AreEqual(expected.Field.Count * 2, actual.FieldLengthField); Assert.AreEqual(0, actual.Field.Count); }
public void LengthBindingTest2() { var expected = new BoundLengthClass <byte[]> { Field = System.Text.Encoding.ASCII.GetBytes("FieldValue") }; var actual = Roundtrip(expected); Assert.AreEqual(expected.Field.Length, actual.FieldLengthField); Assert.IsTrue(expected.Field.SequenceEqual(actual.Field)); }
public void LengthBindingTest() { var expected = new BoundLengthClass <string> { Field = "FieldValue" }; var actual = Roundtrip(expected); Assert.AreEqual(expected.Field.Length, actual.FieldLengthField); Assert.AreEqual(expected.Field, actual.Field); }
public void CollectionLengthTest() { var expected = new BoundLengthClass <List <string> > { Field = new List <string>(TestSequence) }; var actual = Roundtrip(expected); Assert.Equal(expected.Field.Count * 2, actual.FieldLengthField); Assert.Equal(TestSequence.Length, actual.Field.Count); }
public void ComplexFieldLengthTest() { var expected = new BoundLengthClass <ConstLengthClass> { Field = new ConstLengthClass { Field = "FieldValue" } }; var actual = Roundtrip(expected); Assert.AreEqual(3, actual.Field.Field.Length); Assert.AreEqual(6, actual.FieldLengthField); }
public void ContainedCollectionTest() { var expected = new BoundLengthClass <ContainedCollection> { Field = new ContainedCollection { Collection = new List <string> { "hello", "world" } } }; var actual = Roundtrip(expected); Assert.AreEqual(2, actual.Field.Collection.Count); }