コード例 #1
0
        public void Test_setTextLjava_lang_String()
        {
            StringCharacterEnumerator it1 = new StringCharacterEnumerator("testing", 2,
                                                                          4, 4);

            it1.Reset("frog");
            assertEquals("Wrong begin index", 0, it1.StartIndex);
            assertEquals("Wrong end index", 3, it1.EndIndex);
            assertEquals("Wrong current index", 0, it1.Index);
        }
コード例 #2
0
        public void Test_setText()
        {
            StringCharacterEnumerator fixture = new StringCharacterEnumerator("fixture");

            fixture.Reset("fix");
            assertEquals('f', fixture.Current);
            assertTrue(fixture.MoveLast());
            assertEquals('x', fixture.Current);

            try
            {
                fixture.Reset(null);
                fail("no null pointer");
            }
            catch (ArgumentNullException e)
            {
                // expected
            }
        }