Exemplo n.º 1
0
        public void ConfigurationStrongTest()
        {
            string counterName = "strongTestConfiguration";
            var    rcm         = remoteManager.GetCounterManager();
            var    cc          = new CounterConfiguration(0, -256, 65536, 64, CounterType.BOUNDED_STRONG, Storage.VOLATILE);

            rcm.DefineCounter(counterName, cc);
            var counter = rcm.GetStrongCounter(counterName);
            ICounterConfiguration retCc = counter.GetConfiguration();

            Assert.AreEqual(cc.GetLowerBound(), retCc.GetLowerBound());
            Assert.AreEqual(cc.GetUpperBound(), retCc.GetUpperBound());
            Assert.AreEqual(0, retCc.GetConcurrencyLevel());
            Assert.AreEqual(cc.GetType(), retCc.GetType());
            Assert.AreEqual(cc.GetStorage(), retCc.GetStorage());
            Assert.AreEqual(counter.GetName(), counterName);
            rcm.Remove(counterName);

            string counterName1 = "strongTestConfiguration1";
            var    cc1          = new CounterConfiguration(0, -100, 100, 1, CounterType.UNBOUNDED_STRONG,
                                                           Storage.PERSISTENT);

            rcm.DefineCounter(counterName1, cc1);
            counter = rcm.GetStrongCounter(counterName1);
            ICounterConfiguration retCc1 = counter.GetConfiguration();

            Assert.AreEqual(0, retCc1.GetLowerBound());
            Assert.AreEqual(0, retCc1.GetUpperBound());
            Assert.AreEqual(0, retCc1.GetConcurrencyLevel());
            Assert.AreEqual(cc1.GetType(), retCc1.GetType());
            Assert.AreEqual(cc1.GetStorage(), retCc1.GetStorage());
            Assert.AreEqual(counter.GetName(), counterName1);
            rcm.Remove(counterName1);
        }