Exemplo n.º 1
0
        public void TestLongMessage()
        {
            var zw                  = ZeroWidthSpace; // this just makes expectedString shorter
            var expectedString      = $"A{zw}B{zw}A{zw}B{zw}B{zw}B{zw}B{zw}B{zw}";
            var expectedBareMessage = "ABABBBBB";
            var expected            = expectedString.GetEnumerator();

            var longMessage = new AlphaLengthMessage(e1, "1011010110110110110110");

            var unit2 = new AlphaLengthDeserializer(longMessage);

            while (unit2.MoveNext() && expected.MoveNext())
            {
                Assert.AreEqual(expected.Current, unit2.Current);
            }

            expected.Dispose();

            Assert.AreEqual(expectedString, new string(longMessage.ToArray()));
            var bareMessage = new string(longMessage.Where(c => c != ZeroWidthSpace).ToArray());

            Assert.AreEqual(expectedBareMessage, bareMessage);
        }
Exemplo n.º 2
0
 public void MinimalTest()
 {
     unitUnderTest.MoveNext();
     Assert.AreEqual('A', unitUnderTest.Current);
 }