public virtual void TestReturnValue() { c.SetDefaultReturnValue(-1); NUnit.Framework.Assert.AreEqual(c.DefaultReturnValue(), -1.0); NUnit.Framework.Assert.AreEqual(c.GetCount("-!-"), -1.0); c.SetDefaultReturnValue(0.0); NUnit.Framework.Assert.AreEqual(c.GetCount("-!-"), 0.0); }
/// <summary>Constructs a new Counter with the contents of the given Counter.</summary> /// <remarks> /// Constructs a new Counter with the contents of the given Counter. /// <i>Implementation note:</i> A new Counter is allocated with its /// own counts, but keys will be shared and should be an immutable class. /// </remarks> /// <param name="c">The Counter which will be copied.</param> public ClassicCounter(ICounter <E> c) : this() { Counters.AddInPlace(this, c); SetDefaultReturnValue(c.DefaultReturnValue()); }