public void TestAddingElements() { TVerificationResult res; TVerificationResultCollection coll = new TVerificationResultCollection(); Assert.AreEqual(0, coll.Count, "there should be no verification result"); coll.AddAndIgnoreNullValue(null); Assert.AreEqual(0, coll.Count, "there should be no verification result and no exception thrown"); res = new TVerificationResult(null, "test", TResultSeverity.Resv_Noncritical); coll.AddAndIgnoreNullValue(res); Assert.AreEqual(1, coll.Count, "there should be one verification result"); res = new TVerificationResult(null, "test", TResultSeverity.Resv_Noncritical); coll.Add(res); Assert.AreEqual(2, coll.Count, "there should be 2 verification results"); Exception caught = null; try { coll.Add(null); } catch (Exception e) { caught = e; } Assert.IsInstanceOf(typeof(ArgumentException), caught, "there should be an ArgumentException thrown"); Assert.AreEqual(2, coll.Count, "there should be 2 verification results"); }