Example #1
0
        public void CanRegisterCountersOnTheFlyAndDeleteThem()
        {
            try
            {
                using (var session = new TestableTelemetrySessionDerived())
                {
                    Assert.IsFalse(session.Start(), "Required performance counters were already registered, this test has not been performed.");

                    Assert.AreEqual(session.RegisteredCounters.Count(), 2);

                    using (var pc = new PerformanceCounter("BSA.Tests", "Counter1"))
                    {
                        Assert.AreEqual(pc.NextValue(), 0.0f);
                    }
                }
            }
            finally
            {
                WpcTelemetrySessionInstaller.Uninstall(typeof(TestableTelemetrySessionDerived));
            }
        }
 public void Cleanup()
 {
     WpcTelemetrySessionInstaller.Uninstall(typeof(TestableTelemetrySession));
 }