public void GetLocalReturnsServiceSucceeds()
        {
            //Arrange
            DiagnosticsService expected = null;

            MSPDiagnosticsServiceBase.GetLocal <DiagnosticsService>(() => { Assert.IsTrue(expected == null);  expected = new DiagnosticsService(); return(expected); });

            //Act
            var target = DiagnosticsService.Local;

            //Assert
            Assert.IsNotNull(expected);
            Assert.AreEqual <DiagnosticsService>(expected, target);
        }
        public void UnRegisterSucceeds()
        {
            //Arrange
            SPService target = null;

            BSPFarm.SetLocal();
            MSPDiagnosticsServiceBase.GetLocal <DiagnosticsService>(() => new DiagnosticsService());
            MSPService.AllInstances.Delete = (b) => target = b;

            //Act
            DiagnosticsService.Unregister();

            //Assert
            Assert.IsNotNull(target);
            Assert.IsTrue(target.GetType().Equals(typeof(DiagnosticsService)));
        }