Beispiel #1
0
        public void GetHashCodeTest()
        {
            RawRange_Accessor target1 = new RawRange_Accessor
            {
                FirstBook           = "john",
                FirstChapterString  = "3",
                FirstVerseString    = "16",
                SecondBook          = "john",
                SecondChapterString = "3",
                SecondVerseString   = "16"
            };

            RawRange_Accessor target2 = new RawRange_Accessor
            {
                FirstBook           = "john",
                FirstChapterString  = "3",
                FirstVerseString    = "16",
                SecondBook          = "john",
                SecondChapterString = "16",
                SecondVerseString   = "3"
            };

            int actual1 = target1.GetHashCode();
            int actual2 = target2.GetHashCode();

            Assert.AreNotEqual(actual1, actual2);
        }
Beispiel #2
0
        public void ParseVerseStringTest_FormatException3()
        {
            string input  = "3da";
            int    verse  = 0;
            string suffix = string.Empty;

            RawRange_Accessor.ParseVerseString(input, out verse, out suffix);
        }
Beispiel #3
0
        public void ParseVerseStringTest()
        {
            string input          = "3a";
            int    verse          = 0;
            int    verseExpected  = 3;
            string suffix         = string.Empty;
            string suffixExpected = "a";

            RawRange_Accessor.ParseVerseString(input, out verse, out suffix);
            Assert.AreEqual(verseExpected, verse);
            Assert.AreEqual(suffixExpected, suffix);
        }
Beispiel #4
0
        public void FirstVerseStringTest()
        {
            RawRange_Accessor target = new RawRange_Accessor();

            target.FirstVerseString = "3a";
            int    expectedFirstVerse       = 3;
            string expectedFirstVerseSuffix = "a";
            int    actualFirstVerse;

            actualFirstVerse = target.FirstVerse;
            string actualFirstVerseSuffix;

            actualFirstVerseSuffix = target.FirstVerseSuffix;
            Assert.AreEqual(expectedFirstVerse, actualFirstVerse);
            Assert.AreEqual(expectedFirstVerseSuffix, actualFirstVerseSuffix);
        }
Beispiel #5
0
        public void ParseTest_ChapterVerseRange()
        {
            string            block          = "john 3:16 - 5:34";
            string            currentBook    = string.Empty;
            string            currentChapter = string.Empty;
            string            currentVerse   = string.Empty;
            RawRange_Accessor expected       = new RawRange_Accessor
            {
                FirstBook           = "john",
                FirstChapterString  = "3",
                FirstVerseString    = "16",
                SecondBook          = "john",
                SecondChapterString = "5",
                SecondVerseString   = "34"
            };
            RawRange_Accessor actual;

            actual = RawRange_Accessor.Parse(block, currentBook, currentChapter, currentVerse);
            Assert.AreEqual(expected, actual);
        }
Beispiel #6
0
        public void ParseTest_BookRangeWithOneChapter()
        {
            string            block          = "luke - acts 9";
            string            currentBook    = string.Empty;
            string            currentChapter = string.Empty;
            string            currentVerse   = string.Empty;
            RawRange_Accessor expected       = new RawRange_Accessor
            {
                FirstBook           = "luke",
                FirstChapterString  = null,
                FirstVerseString    = null,
                SecondBook          = "acts",
                SecondChapterString = "9",
                SecondVerseString   = null
            };
            RawRange_Accessor actual;

            actual = RawRange_Accessor.Parse(block, currentBook, currentChapter, currentVerse);
            Assert.AreEqual(expected, actual);
        }
Beispiel #7
0
        public void ParseTest_Basic_CurrentBookAndChapter()
        {
            string            block          = "16";
            string            currentBook    = "john";
            string            currentChapter = "3";
            string            currentVerse   = string.Empty;
            RawRange_Accessor expected       = new RawRange_Accessor
            {
                FirstBook           = "john",
                FirstChapterString  = "16",
                FirstVerseString    = null,
                SecondBook          = "john",
                SecondChapterString = "16",
                SecondVerseString   = null
            };
            RawRange_Accessor actual;

            actual = RawRange_Accessor.Parse(block, currentBook, currentChapter, currentVerse);
            Assert.AreEqual(expected, actual);
        }
Beispiel #8
0
        public void ParseTest_VerseRange()
        {
            string            block          = "acts 5:4-9";
            string            currentBook    = string.Empty;
            string            currentChapter = string.Empty;
            string            currentVerse   = string.Empty;
            RawRange_Accessor expected       = new RawRange_Accessor
            {
                FirstBook           = "acts",
                FirstChapterString  = "5",
                FirstVerseString    = "4",
                FirstVerse          = 4,
                SecondBook          = "acts",
                SecondChapterString = "5",
                SecondVerseString   = "9",
                SecondVerse         = 9
            };
            RawRange_Accessor actual;

            actual = RawRange_Accessor.Parse(block, currentBook, currentChapter, currentVerse);
            Assert.AreEqual(expected, actual);
        }
        public void GetHashCodeTest()
        {
            RawRange_Accessor target1 = new RawRange_Accessor
            {
                FirstBook = "john",
                FirstChapterString = "3",
                FirstVerseString = "16",
                SecondBook = "john",
                SecondChapterString = "3",
                SecondVerseString = "16"
            };

            RawRange_Accessor target2 = new RawRange_Accessor
            {
                FirstBook = "john",
                FirstChapterString = "3",
                FirstVerseString = "16",
                SecondBook = "john",
                SecondChapterString = "16",
                SecondVerseString = "3"
            };

            int actual1 = target1.GetHashCode();
            int actual2 = target2.GetHashCode();

            Assert.AreNotEqual(actual1, actual2);
        }
Beispiel #10
0
        public void ParseTest_null()
        {
            RawRange_Accessor actual;

            actual = RawRange_Accessor.Parse(null, null, null, null);
        }
Beispiel #11
0
        public void ParseTest_VerseSuffixRange_ShortVerse()
        {
            string block = "john 3:16b-7a";
            string currentBook = string.Empty;
            string currentChapter = string.Empty;
            string currentVerse = string.Empty;

            RawRange_Accessor expected = new RawRange_Accessor
            {
                FirstBook = "john",
                FirstChapterString = "3",
                FirstVerseString = "16b",
                SecondBook = "john",
                SecondChapterString = "3",
                SecondVerseString = "17a"
            };
            RawRange_Accessor actual;
            actual = RawRange_Accessor.Parse(block, currentBook, currentChapter, currentVerse);
            Assert.AreEqual(expected, actual);
        }
Beispiel #12
0
 public void ParseTest_VerseRange()
 {
     string block = "acts 5:4-9";
     string currentBook = string.Empty;
     string currentChapter = string.Empty;
     string currentVerse = string.Empty;
     RawRange_Accessor expected = new RawRange_Accessor
         {
             FirstBook = "acts",
             FirstChapterString = "5",
             FirstVerseString = "4",
             FirstVerse = 4,
             SecondBook = "acts",
             SecondChapterString = "5",
             SecondVerseString = "9",
             SecondVerse = 9
         };
     RawRange_Accessor actual;
     actual = RawRange_Accessor.Parse(block, currentBook, currentChapter, currentVerse);
     Assert.AreEqual(expected, actual);
 }
Beispiel #13
0
        public void ParseTest_ChapterRangeWithVerse()
        {
            string block = "john 3-5:34";
            string currentBook = string.Empty;
            string currentChapter = string.Empty;
            string currentVerse = string.Empty;

            RawRange_Accessor expected = new RawRange_Accessor
            {
                FirstBook = "john",
                FirstChapterString = "3",
                FirstVerseString = null,
                SecondBook = "john",
                SecondChapterString = "5",
                SecondVerseString = "34"
            };
            RawRange_Accessor actual;
            actual = RawRange_Accessor.Parse(block, currentBook, currentChapter, currentVerse);
            Assert.AreEqual(expected, actual);
        }
Beispiel #14
0
 public void ParseTest_BookRangeWithOneChapter()
 {
     string block = "luke - acts 9";
     string currentBook = string.Empty;
     string currentChapter = string.Empty;
     string currentVerse = string.Empty;
     RawRange_Accessor expected = new RawRange_Accessor
     {
         FirstBook = "luke",
         FirstChapterString = null,
         FirstVerseString = null,
         SecondBook = "acts",
         SecondChapterString = "9",
         SecondVerseString = null
     };
     RawRange_Accessor actual;
     actual = RawRange_Accessor.Parse(block, currentBook, currentChapter, currentVerse);
     Assert.AreEqual(expected, actual);
 }
Beispiel #15
0
        public void ParseTest_BookChapterVerseRange_CurrentBook()
        {
            string block = "3:5-john 4:34";
            string currentBook = "jn";
            string currentChapter = string.Empty;
            string currentVerse = string.Empty;

            RawRange_Accessor expected = new RawRange_Accessor
            {
                FirstBook = "jn",
                FirstChapterString = "3",
                FirstVerseString = "5",
                SecondBook = "john",
                SecondChapterString = "4",
                SecondVerseString = "34"
            };
            RawRange_Accessor actual;
            actual = RawRange_Accessor.Parse(block, currentBook, currentChapter, currentVerse);
            Assert.AreEqual(expected, actual);
        }
Beispiel #16
0
 public void ParseTest_Basic_CurrentBookAndChapter()
 {
     string block = "16";
     string currentBook = "john";
     string currentChapter = "3";
     string currentVerse = string.Empty;
     RawRange_Accessor expected = new RawRange_Accessor
     {
         FirstBook = "john",
         FirstChapterString = "16",
         FirstVerseString = null,
         SecondBook = "john",
         SecondChapterString = "16",
         SecondVerseString = null
     };
     RawRange_Accessor actual;
     actual = RawRange_Accessor.Parse(block, currentBook, currentChapter, currentVerse);
     Assert.AreEqual(expected, actual);
 }
Beispiel #17
0
        public void ParseTest_NoBook()
        {
            RawRange_Accessor actual;

            actual = RawRange_Accessor.Parse("3:16-john 3:17", null, null, null);
        }
Beispiel #18
0
 public void FirstVerseStringTest()
 {
     RawRange_Accessor target = new RawRange_Accessor();
     target.FirstVerseString = "3a";
     int expectedFirstVerse = 3;
     string expectedFirstVerseSuffix = "a";
     int actualFirstVerse;
     actualFirstVerse = target.FirstVerse;
     string actualFirstVerseSuffix;
     actualFirstVerseSuffix = target.FirstVerseSuffix;
     Assert.AreEqual(expectedFirstVerse, actualFirstVerse);
     Assert.AreEqual(expectedFirstVerseSuffix, actualFirstVerseSuffix);
 }