Inheritance: Dev2.Studio.ViewModels.WorkSurface.BaseWorkSurfaceViewModel, IStudioTab
        public void SettingsViewModel_Constructor_Properties_Initialized()
        {
            //------------Setup for test--------------------------

            //------------Execute Test---------------------------
            var settingsViewModel = new SettingsViewModel(new Mock<IEventAggregator>().Object, new Mock<IPopupController>().Object, new Mock<IAsyncWorker>().Object, new Mock<IWin32Window>().Object, new Mock<IConnectControlViewModel>().Object);

            //------------Assert Results-------------------------
            Assert.IsFalse(settingsViewModel.ShowLogging);
            Assert.IsTrue(settingsViewModel.ShowSecurity);
        }
        public void SettingsViewModel_ServerChangedCommand_ServerEnvironmentIsNotConnected_CurrentEnvironmentSetButNotConnected()
        {
            //------------Setup for test--------------------------
            var popupController = new Mock<IPopupController>();
            popupController.Setup(p => p.ShowNotConnected()).Verifiable();

            var viewModel = new SettingsViewModel(new Mock<IEventAggregator>().Object, popupController.Object, AsyncWorkerTests.CreateSynchronousAsyncWorker().Object, new Mock<IWin32Window>().Object, new Mock<IConnectControlViewModel>().Object);

            var mockConnection = new Mock<IEnvironmentConnection>();
            mockConnection.Setup(c => c.IsConnected).Returns(false);
            mockConnection.Setup(connection => connection.ServerEvents).Returns(new Mock<IEventPublisher>().Object);
            var mockResourceRepo = new Mock<IResourceRepository>();
            var server = new EnvironmentModel(Guid.NewGuid(), mockConnection.Object, mockResourceRepo.Object, new Mock<IStudioResourceRepository>().Object);

            Assert.IsNull(viewModel.CurrentEnvironment);
            Assert.IsTrue(server.CanStudioExecute);

            //------------Execute Test---------------------------
            viewModel.ServerChangedCommand.Execute(server);

            //------------Assert Results-------------------------
            Assert.IsNotNull(viewModel.CurrentEnvironment);
            Assert.IsFalse(viewModel.CurrentEnvironment.IsConnected);
        }
        public void SettingsViewModel_ServerChangedCommand_ServerEnvironmentNotConnected_DoesNothing()
        {
            //------------Setup for test--------------------------
            var viewModel = new SettingsViewModel(new Mock<IEventAggregator>().Object, new Mock<IPopupController>().Object, AsyncWorkerTests.CreateSynchronousAsyncWorker().Object, new Mock<IWin32Window>().Object, new Mock<IConnectControlViewModel>().Object);
            Assert.IsNull(viewModel.CurrentEnvironment);

            var server = new Mock<IEnvironmentModel>();

            //------------Execute Test---------------------------
            viewModel.ServerChangedCommand.Execute(server.Object);

            //------------Assert Results-------------------------
            Assert.IsNotNull(viewModel.CurrentEnvironment);
            Assert.IsFalse(viewModel.CurrentEnvironment.IsConnected);
        }
        public void SettingsViewModel_ShowSecurity_DifferentValue_DoesRaisePropertyChanged()
        {
            //------------Setup for test--------------------------
            var propertyChanged = false;

            var settingsViewModel = new SettingsViewModel(new Mock<IEventAggregator>().Object, new Mock<IPopupController>().Object, new Mock<IAsyncWorker>().Object, new Mock<IWin32Window>().Object, new Mock<IConnectControlViewModel>().Object) { ShowSecurity = true };
            settingsViewModel.PropertyChanged += (sender, args) => propertyChanged = true;

            //------------Execute Test---------------------------
            settingsViewModel.ShowSecurity = false;

            //------------Assert Results-------------------------
            Assert.IsTrue(propertyChanged);
        }
        public void SettingsViewModel_ShowSecurity_True_OtherShowPropertiesAreFalse()
        {
            //------------Setup for test--------------------------
            var settingsViewModel = new SettingsViewModel(new Mock<IEventAggregator>().Object, new Mock<IPopupController>().Object, new Mock<IAsyncWorker>().Object, new Mock<IWin32Window>().Object, new Mock<IConnectControlViewModel>().Object) { ShowSecurity = false };

            //------------Execute Test---------------------------
            settingsViewModel.ShowSecurity = true;

            //------------Assert Results-------------------------
            Assert.IsFalse(settingsViewModel.ShowLogging);
        }
        public void SettingsViewModel_ServerChangedCommand_XX()
        {
            //------------Setup for test--------------------------
            var viewModel = new SettingsViewModel(new Mock<IEventAggregator>().Object, new Mock<IPopupController>().Object, new TestAsyncWorker(), new Mock<IWin32Window>().Object, new Mock<IConnectControlViewModel>().Object);
            Assert.IsNull(viewModel.CurrentEnvironment);

            //------------Execute Test---------------------------
            viewModel.ServerChangedCommand.Execute(null);

            //------------Assert Results-------------------------
            Assert.IsNull(viewModel.CurrentEnvironment);
        }