Esempio n. 1
0
        public void testEquals()
        {
            var a = new RawText(Constants.encodeASCII("foo-a\nfoo-b\n"));
            var b = new RawText(Constants.encodeASCII("foo-b\nfoo-c\n"));

            Assert.AreEqual(2, a.size());
            Assert.AreEqual(2, b.size());

            // foo-a != foo-b
            Assert.IsFalse(a.equals(0, b, 0));
            Assert.IsFalse(b.equals(0, a, 0));

            // foo-b == foo-b
            Assert.IsTrue(a.equals(1, b, 0));
            Assert.IsTrue(b.equals(0, a, 1));
        }
Esempio n. 2
0
        public void testEmpty()
        {
            var r = new RawText(new byte[0]);

            Assert.AreEqual(0, r.size());
        }