Пример #1
0
        public void TryGetValue()
        {
            var coll = new RowErrorCollection(5);

            coll.Add(this, new WarningEventArgs(1, 1, "Message1", 100, 100, "ColName"));
            Assert.IsTrue(coll.TryGetValue(1, out var val));
        }
        public void WarningListCombineWarning()
        {
            var messageList = new RowErrorCollection(10);

            messageList.Add(null, new WarningEventArgs(1, 1, "Text1", 0, 0, null));
            messageList.Add(null, new WarningEventArgs(1, 1, "Text2", 0, 1, null));
            Assert.AreEqual(1, messageList.CountRows);
            Assert.IsTrue(
                "Text1" + ErrorInformation.cSeparator + "Text2" == messageList.Display ||
                "Text2" + ErrorInformation.cSeparator + "Text1" == messageList.Display);
            _ = new ColumnErrorDictionary();
            messageList.TryGetValue(1, out var ce);
            Assert.AreEqual(1, ce.Count);
            Assert.AreEqual(messageList.Display, ce.Display);
        }