Exemple #1
0
        public void TestGetSameCountAndNextKey()
        {
            AntString antStr = new AntString("110001110");

            Assert.AreEqual("1", antStr.getKey());

            int nextKeyPosition = antStr.getSameCount();

            antStr.nextKeyPosition(nextKeyPosition);
            Assert.AreEqual("0", antStr.getKey());

            nextKeyPosition = antStr.getSameCount();
            antStr.nextKeyPosition(nextKeyPosition);
            Assert.AreEqual("1", antStr.getKey());

            nextKeyPosition = antStr.getSameCount();
            antStr.nextKeyPosition(nextKeyPosition);
            Assert.AreEqual("0", antStr.getKey());
        }
Exemple #2
0
        public void TestGetSameCount()
        {
            AntString antStr = new AntString("111100");

            Assert.AreEqual(4, antStr.getSameCount());
        }