public void PerfcounterViewModel_ServerCountersCompare_Given_Null_Server_Counters_Returns_False()
        {
            CommonSetupHelper.RegisterServerRepository();
            var authorizationService = new Mock <IAuthorizationService>();
            var securityService      = new Mock <ISecurityService>();
            var permissions          = new List <WindowsGroupPermission> {
                new WindowsGroupPermission()
            };

            securityService.Setup(service => service.Permissions).Returns(permissions);
            authorizationService.Setup(service => service.SecurityService).Returns(securityService.Object);
            _mockConnection.Setup(connection => connection.IsConnected).Returns(true);
            _mockConnection.Setup(connection => connection.DisplayName).Returns("TestServer");
            _mockEnvironment.Setup(model => model.AuthorizationService).Returns(authorizationService.Object);
            var activeServer = new Server(Guid.NewGuid(), _mockConnection.Object);

            ServerRepository.Instance.ActiveServer = activeServer;
            var counters = new PrivateType(typeof(PerfcounterViewModel));

            CustomContainer.Register(new Mock <IExplorerTooltips>().Object);
            //------------Setup for test------------------------
            //------------Execute Test--------------------------
            var invokeStatic = counters.InvokeStatic("GetEnvironment");

            //------------Assert Results-------------------------
            Assert.IsNotNull(invokeStatic);
        }
        public void PerfcounterViewModel_Equals_Given_Null_Server_Counters_Returns_False()
        {
            CommonSetupHelper.RegisterServerRepository();
            CustomContainer.Register <IExplorerTooltips>(new ExplorerTooltips());
            var perfCounterTo = new Mock <IPerformanceCounterTo>();

            perfCounterTo.Setup(to => to.ResourceCounters).Returns(new List <IResourcePerformanceCounter>());
            perfCounterTo.Setup(to => to.NativeCounters).Returns(new List <IPerformanceCounter>());
            var perfcounterViewModel = new PerfcounterViewModel(perfCounterTo.Object, new Mock <IServer>().Object);
            var counters             = new PrivateObject(perfcounterViewModel);
            //------------Setup for test--------------------------
            var ItemServerCounters = perfcounterViewModel.ServerCounters = null;
            //------------Execute Test---------------------------
            var areEqual = counters.Invoke("Equals", args: new object[] { null, ItemServerCounters });

            //------------Assert Results-------------------------
            Assert.IsFalse(areEqual.Equals(true));
        }