protected virtual void SetUp()
 {
     c = new TwoDimensionalCounter <string, string>();
     c.SetCount("a", "a", 1.0);
     c.SetCount("a", "b", 2.0);
     c.SetCount("a", "c", 3.0);
     c.SetCount("b", "a", 4.0);
     c.SetCount("b", "b", 5.0);
     c.SetCount("c", "a", 6.0);
 }
Example #2
0
        public virtual void TestDivideInPlace()
        {
            TwoDimensionalCounter <string, string> a = new TwoDimensionalCounter <string, string>();

            a.SetCount("a", "b", 1);
            a.SetCount("a", "c", 1);
            a.SetCount("c", "a", 1);
            a.SetCount("c", "b", 1);
            Counters.DivideInPlace(a, a.TotalCount());
            NUnit.Framework.Assert.AreEqual(1.0, a.TotalCount());
            NUnit.Framework.Assert.AreEqual(0.25, a.GetCount("a", "b"));
        }