Mercurial > repos > IBBoard.Ini.Tests
annotate IniFileReaderTest.cs @ 13:48b646dd1dc2 default tip
* Automated clean-up of .csproj file
* Ignore generated files
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 07 Nov 2012 20:23:16 +0000 |
parents | 0be17f8102ed |
children |
rev | line source |
---|---|
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 // This file (IniFileReaderTest.cs) is a part of the IBBoard.Ini.Tests library and is copyright 2009 IBBoard. |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 // |
6 | 3 // The file and the library/program it is in are licensed under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING.LGPL for more information and the full license. |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 using System; |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 using System.IO; |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 using NUnit.Framework; |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 namespace IBBoard.Ini |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 { |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 [TestFixture()] |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 public class IniFileReaderTest |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 { |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 [Test()] |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 public void TestIniFileReaderReturnsEmptyObjectForEmptyIniText() |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 { |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
16 IniFile file = IniFileReader.ReadFile(""); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
17 Assert.AreEqual(0, file.Sections.Length); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 } |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
19 |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
20 [Test()] |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
21 public void TestIniFileReaderContainsExpectedSectionForSingleSectionIniText() |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
22 { |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
23 IniFile file = IniFileReader.ReadFile("[ASection]"); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 Assert.AreEqual(1, file.Sections.Length); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 Assert.IsTrue(file.HasSection("ASection")); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
26 Assert.IsNotNull(file["ASection"]); |
1 | 27 Assert.AreEqual(0, file["ASection"].Keys.Length); |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
28 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["ASection"]); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
29 } |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
30 |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
31 [Test()] |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
32 public void TestIniFileReaderContainsExpectedSectionForSingleSectionIniTextWithContent() |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
33 { |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
34 IniFile file = IniFileReader.ReadFile("[ASection]\nsomething=fibble"); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
35 Assert.AreEqual(1, file.Sections.Length); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
36 Assert.IsTrue(file.HasSection("ASection")); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
37 Assert.IsNotNull(file["ASection"]); |
1 | 38 Assert.AreEqual(1, file["ASection"].Keys.Length); |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
39 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["ASection"]); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
40 } |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
41 |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
42 [Test()] |
1 | 43 public void TestIniFileReaderContainsExpectedSectionForSingleSectionIniTextWithMultiLineContent() |
44 { | |
45 IniFile file = IniFileReader.ReadFile("[ASection]\nsomething=fibble\nfobble_key=foo\nabcde=fghij\nfoo9=bar2"); | |
46 Assert.AreEqual(1, file.Sections.Length); | |
47 Assert.IsTrue(file.HasSection("ASection")); | |
48 IniSection section = file["ASection"]; | |
49 Assert.IsNotNull(section); | |
50 Assert.AreEqual(4, section.Keys.Length); | |
51 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["ASection"]); | |
52 | |
53 string[] keys = new string[]{"something", "fobble_key", "abcde", "foo9"}; | |
54 | |
55 foreach (string key in keys) | |
56 { | |
57 bool found = false; | |
58 | |
59 foreach (string sectionKey in section.Keys) | |
60 { | |
61 if (key == sectionKey) | |
62 { | |
63 found = true; | |
64 break; | |
65 } | |
66 } | |
67 | |
12 | 68 Assert.IsTrue(found, "Did not find " + key); |
1 | 69 } |
70 } | |
71 | |
72 [Test()] | |
2 | 73 public void TestIniFileReaderContainsExpectedSectionsForTwoSectionIniTextWithContent() |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
74 { |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
75 IniFile file = IniFileReader.ReadFile("[ASection]\nsomething=fibble\n[BSection]\nsomethingElse=fibble"); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
76 Assert.AreEqual(2, file.Sections.Length); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
77 Assert.IsTrue(file.HasSection("ASection")); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
78 Assert.IsNotNull(file["ASection"]); |
1 | 79 Assert.AreEqual(1, file["ASection"].Keys.Length); |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
80 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["ASection"]); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
81 Assert.IsTrue(file.HasSection("BSection")); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
82 Assert.IsNotNull(file["BSection"]); |
1 | 83 Assert.AreEqual(1, file["BSection"].Keys.Length); |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
84 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["BSection"]); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
85 } |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
86 |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
87 [Test()] |
2 | 88 public void TestIniFileReaderContainsExpectedSectionsForTwoConsecutiveSectionSectionsInText() |
89 { | |
90 IniFile file = IniFileReader.ReadFile("[SectionA]\n[SectionB]"); | |
91 Assert.AreEqual(2, file.Sections.Length); | |
92 Assert.IsTrue(file.HasSection("SectionA")); | |
93 Assert.IsNotNull(file["SectionA"]); | |
94 Assert.AreEqual(0, file["SectionA"].Keys.Length); | |
95 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["SectionA"]); | |
96 Assert.IsTrue(file.HasSection("SectionB")); | |
97 Assert.IsNotNull(file["SectionB"]); | |
98 Assert.AreEqual(0, file["SectionB"].Keys.Length); | |
99 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["SectionB"]); | |
100 } | |
101 | |
102 [Test()] | |
103 public void TestIniFileReaderContainsExpectedSectionWhenTextPaddedAtStart() | |
104 { | |
105 IniFile file = IniFileReader.ReadFile("\nnon-blank\n[ASection]\nsomething=fibble"); | |
106 Assert.AreEqual(1, file.Sections.Length); | |
107 Assert.IsTrue(file.HasSection("ASection")); | |
108 Assert.IsNotNull(file["ASection"]); | |
109 Assert.AreEqual(1, file["ASection"].Keys.Length); | |
110 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["ASection"]); | |
111 } | |
112 | |
113 [Test()] | |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
114 public void TestIniFileReaderReturnsEmptyObjectForEmptyIniFile() |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
115 { |
12 | 116 IniFile file = IniFileReader.ReadFile(new FileInfo("TestData/EmptyFile.ini")); |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
117 Assert.AreEqual(0, file.Sections.Length); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
118 } |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
119 |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
120 [Test()] |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
121 public void TestIniFileReaderContainsExpectedSectionForSingleSectionIniFile() |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
122 { |
12 | 123 IniFile file = IniFileReader.ReadFile(new FileInfo("TestData/SingleSectionSingleLine.ini")); |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
124 Assert.AreEqual(1, file.Sections.Length); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
125 Assert.IsTrue(file.HasSection("ASection")); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
126 Assert.IsNotNull(file["ASection"]); |
1 | 127 Assert.AreEqual(0, file["ASection"].Keys.Length); |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
128 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["ASection"]); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
129 } |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
130 |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
131 [Test()] |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
132 public void TestIniFileReaderContainsExpectedSectionForSingleSectionIniFileWithContent() |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
133 { |
12 | 134 IniFile file = IniFileReader.ReadFile(new FileInfo("TestData/SingleSectionWithContent.ini")); |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
135 Assert.AreEqual(1, file.Sections.Length); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
136 Assert.IsTrue(file.HasSection("ASection")); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
137 Assert.IsNotNull(file["ASection"]); |
1 | 138 Assert.AreEqual(1, file["ASection"].Keys.Length); |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
139 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["ASection"]); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
140 } |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
141 |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
142 [Test()] |
2 | 143 public void TestIniFileReaderContainsExpectedSectionsForTwoSectionIniFileWithContent() |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
144 { |
12 | 145 IniFile file = IniFileReader.ReadFile(new FileInfo("TestData/DoubleSectionWithContent.ini")); |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
146 Assert.AreEqual(2, file.Sections.Length); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
147 Assert.IsTrue(file.HasSection("ASection")); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
148 Assert.IsNotNull(file["ASection"]); |
1 | 149 Assert.AreEqual(1, file["ASection"].Keys.Length); |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
150 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["ASection"]); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
151 Assert.IsTrue(file.HasSection("BSection")); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
152 Assert.IsNotNull(file["BSection"]); |
1 | 153 Assert.AreEqual(1, file["BSection"].Keys.Length); |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
154 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["BSection"]); |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
155 } |
1 | 156 |
157 [Test()] | |
158 public void TestIniFileReaderContainsExpectedSectionForSingleSectionIniFileWithMultiLineContent() | |
159 { | |
12 | 160 IniFile file = IniFileReader.ReadFile(new FileInfo("TestData/SingleSectionWithMultiLineContent.ini")); |
1 | 161 Assert.AreEqual(1, file.Sections.Length); |
162 Assert.IsTrue(file.HasSection("ASection")); | |
163 IniSection section = file["ASection"]; | |
164 Assert.IsNotNull(section); | |
165 Assert.AreEqual(4, section.Keys.Length); | |
166 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["ASection"]); | |
167 | |
168 string[] keys = new string[]{"something", "fobble_key", "abcde", "foo9"}; | |
169 | |
170 foreach (string key in keys) | |
171 { | |
172 bool found = false; | |
173 | |
174 foreach (string sectionKey in section.Keys) | |
175 { | |
176 if (key == sectionKey) | |
177 { | |
178 found = true; | |
179 break; | |
180 } | |
181 } | |
182 | |
12 | 183 Assert.IsTrue(found, "Did not find " + key); |
1 | 184 } |
185 } | |
2 | 186 |
187 [Test()] | |
188 public void TestIniFileReaderContainsExpectedSectionWhenFilePaddedAtStart() | |
189 { | |
12 | 190 IniFile file = IniFileReader.ReadFile(new FileInfo("TestData/StartPadded.ini")); |
2 | 191 Assert.AreEqual(1, file.Sections.Length); |
192 Assert.IsTrue(file.HasSection("ASection")); | |
193 Assert.IsNotNull(file["ASection"]); | |
194 Assert.AreEqual(1, file["ASection"].Keys.Length); | |
195 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["ASection"]); | |
196 } | |
197 | |
198 [Test()] | |
199 public void TestIniFileReaderContainsExpectedSectionsForTwoConsecutiveSectionSectionsInFile() | |
200 { | |
12 | 201 IniFile file = IniFileReader.ReadFile(new FileInfo("TestData/ConsecutiveSection.ini")); |
2 | 202 Assert.AreEqual(2, file.Sections.Length); |
203 Assert.IsTrue(file.HasSection("SectionA")); | |
204 Assert.IsNotNull(file["SectionA"]); | |
205 Assert.AreEqual(0, file["SectionA"].Keys.Length); | |
206 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["SectionA"]); | |
207 Assert.IsTrue(file.HasSection("SectionB")); | |
208 Assert.IsNotNull(file["SectionB"]); | |
209 Assert.AreEqual(0, file["SectionB"].Keys.Length); | |
210 Assert.IsNotInstanceOfType(typeof(NonExistantIniSection), file["SectionB"]); | |
211 } | |
0
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
212 } |
ada654b0648c
Re #7 - add IBBoard.Ini test\n * Add initial tests
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
213 } |