PageRenderTime 13ms CodeModel.GetById 2ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/Source Code/UnitTests/BibleReferenceTest.vb

#
Visual Basic | 63 lines | 41 code | 12 blank | 10 comment | 0 complexity | 75717ec43b47a0f71b249005fcc894d2 MD5 | raw file
 1Imports Microsoft.VisualStudio.TestTools.UnitTesting
 2Imports PowerSong.SongDatabase.Bibles
 3
 4'''<summary>
 5'''This is a test class for BibleReferenceTest and is intended
 6'''to contain all BibleReferenceTest Unit Tests
 7'''</summary>
 8<TestClass()> _
 9Public Class BibleReferenceTest
10
11    '''<summary>
12    '''A test for ToString
13    '''</summary>
14    <TestMethod()> _
15    Public Sub ToStringTest()
16
17        Dim Ref1 As New BibleReference(BibleSupport.BibleBook.Acts, 1, 1)
18        Dim Ref2 As New BibleReference(BibleSupport.BibleBook.Deuteronomy, 2, 31)
19        Dim Ref3 As New BibleReference(BibleSupport.BibleBook.Joshua, 14, 2)
20        Dim Ref4 As New BibleReference(BibleSupport.BibleBook.Titus, 12, 8)
21        Dim Ref5 As New BibleReference(BibleSupport.BibleBook.Zechariah, 9, 10)
22
23        Assert.AreEqual("Acts 1:1", Ref1.ToString)
24        Assert.AreEqual("Deuteronomy 2:31", Ref2.ToString)
25        Assert.AreEqual("Joshua 14:2", Ref3.ToString)
26        Assert.AreEqual("Titus 12:8", Ref4.ToString)
27        Assert.AreEqual("Zechariah 9:10", Ref5.ToString)
28
29    End Sub
30
31    '''<summary>
32    '''A test for BibleReference Constructor
33    '''</summary>
34    <TestMethod()> _
35    Public Sub BibleReferenceConstructorTest()
36
37        Dim Ref1 As New BibleReference(BibleSupport.BibleBook.Acts, 1, 1)
38        Dim Ref2 As New BibleReference(BibleSupport.BibleBook.Deuteronomy, 2, 31)
39        Dim Ref3 As New BibleReference(BibleSupport.BibleBook.Joshua, 14, 2)
40        Dim Ref4 As New BibleReference(BibleSupport.BibleBook.Titus, 12, 8)
41        Dim Ref5 As New BibleReference(BibleSupport.BibleBook.Zechariah, 9, 10)
42
43        Assert.AreEqual(BibleSupport.BibleBook.Acts, Ref1.Book)
44        Assert.AreEqual(BibleSupport.BibleBook.Deuteronomy, Ref2.Book)
45        Assert.AreEqual(BibleSupport.BibleBook.Joshua, Ref3.Book)
46        Assert.AreEqual(BibleSupport.BibleBook.Titus, Ref4.Book)
47        Assert.AreEqual(BibleSupport.BibleBook.Zechariah, Ref5.Book)
48
49        Assert.AreEqual(1, Ref1.Chapter)
50        Assert.AreEqual(2, Ref2.Chapter)
51        Assert.AreEqual(14, Ref3.Chapter)
52        Assert.AreEqual(12, Ref4.Chapter)
53        Assert.AreEqual(9, Ref5.Chapter)
54
55        Assert.AreEqual(1, Ref1.Verse)
56        Assert.AreEqual(31, Ref2.Verse)
57        Assert.AreEqual(2, Ref3.Verse)
58        Assert.AreEqual(8, Ref4.Verse)
59        Assert.AreEqual(10, Ref5.Verse)
60
61    End Sub
62
63End Class