public void CustomSourceBindingTest() { var expected = new CustomSourceBinding { NameLength = new Varuint(), Name = "Alice" }; var nameLength = System.Text.Encoding.UTF8.GetByteCount(expected.Name); var actual = Roundtrip(expected, nameLength + 1); Assert.AreEqual(expected.Name, actual.Name); }
public void CustomSourceBindingTest2() { var expected = new CustomSourceBinding { NameLength = new Varuint(), Name = "This is rather as if you imagine a puddle waking up one morning and thinking, 'This is an interesting world I find myself in — an interesting hole I find myself in — fits me rather neatly, doesn't it? In fact it fits me staggeringly well, must have been made to have me in it!' This is such a powerful idea that as the sun rises in the sky and the air heats up and as, gradually, the puddle gets smaller and smaller, frantically hanging on to the notion that everything's going to be alright, because this world was meant to have him in it, was built to have him in it; so the moment he disappears catches him rather by surprise. I think this may be something we need to be on the watch out for." }; var nameLength = System.Text.Encoding.UTF8.GetByteCount(expected.Name); var actual = Roundtrip(expected, nameLength + 2); Assert.AreEqual(expected.Name, actual.Name); }