Example #1
0
        public virtual void TestMakeCompactString()
        {
            string   Gc1      = "group1.counter1:1";
            string   Gc2      = "group2.counter2:3";
            Counters counters = new Counters();

            counters.IncrCounter("group1", "counter1", 1);
            NUnit.Framework.Assert.AreEqual("group1.counter1:1", counters.MakeCompactString()
                                            );
            counters.IncrCounter("group2", "counter2", 3);
            string cs = counters.MakeCompactString();

            NUnit.Framework.Assert.IsTrue("Bad compact string", cs.Equals(Gc1 + ',' + Gc2) ||
                                          cs.Equals(Gc2 + ',' + Gc1));
        }