--- /dev/null
+//\r
+// MonoTests.System.Resources.AllTests.cs\r
+//\r
+// Author:\r
+// Nick Drochak (ndrochak@gol.com)\r
+//\r
+// (C) 2001 Nick Drochak II\r
+//\r
+\r
+using System;\r
+using NUnit.Framework;\r
+\r
+namespace MonoTests.System.Resources {\r
+ public class AllTests : TestCase {\r
+ public AllTests(string name) : base(name) {}\r
+ \r
+ public static ITest Suite \r
+ { \r
+ get \r
+ {\r
+ TestSuite suite = new TestSuite();\r
+ suite.AddTest(ResourceReaderTest.Suite);\r
+ return suite;\r
+ }\r
+ }\r
+ }\r
+}\r
+2002-01-25 Nick Drochak <ndrochak@gol.com>\r
+\r
+ * AllTests.cs:\r
+ * Empty.resources:\r
+ * MyResources.resources: Added files\r
+ * ResourceReaderTest.cs: Test the enumerator\r
+\r
2002-01-24 Nick Drochak <ndrochak@gol.com>\r
\r
* ResourceReaderTest.cs: Add new file. This test is not done yet.\r
\r
public class ResourceReaderTest : TestCase {\r
private static string m_ResourceFile = "MyResources.resources";\r
- private static string m_BadResourceFile = "Bad.resources";\r
+ private static string m_BadResourceFile = "Empty.resources";\r
\r
public ResourceReaderTest(String name) : base(name) {\r
}\r
Stream stream = new FileStream (m_ResourceFile, FileMode.Open);\r
reader = new ResourceReader(stream);\r
IDictionaryEnumerator en = reader.GetEnumerator();\r
- \r
// Goes through the enumerator, printing out the key and value pairs.\r
while (en.MoveNext()) {\r
- Console.WriteLine();\r
- Console.WriteLine("Name: {0}", en.Key);\r
- Console.WriteLine("Value: {0}", en.Value);\r
+ DictionaryEntry de = (DictionaryEntry)en.Current;\r
+ Assert("Current.Key should not be empty",String.Empty != de.Key);\r
+ Assert("Current.Value should not be empty",String.Empty != de.Value);\r
+ Assert("Current.Value should not be empty",String.Empty != de.Value);\r
+ Assert("Entry.Key should not be empty",String.Empty != en.Key);\r
+ Assert("Entry.Value should not be empty",String.Empty != en.Value);\r
}\r
reader.Close();\r
}\r