Inheritance: Dev2.Settings.SettingsViewModel
        static TestSettingsViewModel CreateSettingsViewModel(IPopupController popupController, string executeCommandReadResult = "", string executeCommandWriteResult = "", SecurityViewModel securityViewModel = null)
        {
            var viewModel = new TestSettingsViewModel(new Mock<IEventAggregator>().Object, popupController, AsyncWorkerTests.CreateSynchronousAsyncWorker().Object, new Mock<IWin32Window>().Object) { TheSecurityViewModel = securityViewModel };

            var mockResourceRepo = new Mock<IResourceRepository>();

            ExecuteMessage writeMsg = null;
            if(!string.IsNullOrEmpty(executeCommandWriteResult))
            {
                writeMsg = new ExecuteMessage { HasError = executeCommandWriteResult != "Success" };
                writeMsg.SetMessage(executeCommandWriteResult);
            }

            mockResourceRepo.Setup(c => c.ReadSettings(It.IsAny<IEnvironmentModel>())).Returns(executeCommandReadResult == null ? null : new Dev2JsonSerializer().Deserialize<Data.Settings.Settings>(executeCommandReadResult));
            mockResourceRepo.Setup(c => c.WriteSettings(It.IsAny<IEnvironmentModel>(), It.IsAny<Data.Settings.Settings>())).Returns(writeMsg);

            var environment = new Mock<IEnvironmentModel>();
            environment.Setup(e => e.IsConnected).Returns(true);
            environment.Setup(c => c.ResourceRepository).Returns(mockResourceRepo.Object);
            Mock<IAuthorizationService> authService = new Mock<IAuthorizationService>();
            authService.Setup(c => c.IsAuthorized(It.IsAny<AuthorizationContext>(), It.IsAny<string>())).Returns(true);
            environment.Setup(c => c.AuthorizationService).Returns(authService.Object);

            // simulate auto-loading of ConnectControl ComboBox
            viewModel.ServerChangedCommand.Execute(environment.Object);

            return viewModel;
        }
        void Verify_PropertyChangedFired(string propertyName, SettingsProperty settingsProperty)
        {
            //------------Setup for test--------------------------
            var propertyChanged = false;
            var viewModel = new TestSettingsViewModel(new Mock<IEventAggregator>().Object, new Mock<IPopupController>().Object, AsyncWorkerTests.CreateSynchronousAsyncWorker().Object, new Mock<IWin32Window>().Object);
            viewModel.PropertyChanged += (sender, args) =>
            {
                if(args.PropertyName == propertyName)
                {
                    propertyChanged = true;
                }
            };

            //------------Execute Test---------------------------
            switch(settingsProperty)
            {
                case SettingsProperty.HasErrors:
                    viewModel.HasErrors = true;
                    break;
                case SettingsProperty.IsDirty:
                    viewModel.IsDirty = true;
                    break;
                case SettingsProperty.IsSaved:
                    viewModel.IsSaved = true;
                    break;
            }

            //------------Assert Results-------------------------
            Assert.IsTrue(propertyChanged);
        }