Ejemplo n.º 1
0
        public void AsTextTest()
        {
            ErrorDictionary target = new ErrorDictionary();
            string          actual;

            actual = target.AsText();
            Assert.AreEqual(string.Empty, actual);

            ErrorCollection field1 = new ErrorCollection();

            field1.Add("Test 1");
            target.Add("field1", field1);
            actual = target.AsText();
            Assert.AreEqual("* Test 1", actual);

            ErrorCollection field2 = new ErrorCollection();

            field2.Add("Test 2");
            target.Add("field2", field2);
            actual = target.AsText();
            Assert.AreEqual("* Test 1\n* Test 2", actual);

            target["field1"].Add("Test 3");
            actual = target.AsText();
            Assert.AreEqual("* Test 1\n* Test 3\n* Test 2", actual);
        }