private void UpdateViewWithLocalInstances(GetLocalInstances getLocalInstances) { var localInstances = getLocalInstances.LocalInstances(); if (localInstances.GetEnumerator().MoveNext()) { m_View.SetLocalInstances(localInstances); } else { m_View.SetFormEnabledState(EnabledState.Disabled); m_View.ShowWarning("There are no local SQL Server instances on this computer. Try running the SQL Virtual Restore Wizard on a computer that has a SQL Server instance installed."); } }
public void SetUp() { m_TestConnection = m_Mocks.StrictMock <TestConnection>(); m_PassingConnectionStatus = new ConnectionStatus(true, "", new List <DbObjectName>(), "datapath"); m_FailingConnectionStatus = new ConnectionStatus(false, "you're just plain wrong", new List <DbObjectName>(), ""); m_DefaultView = new StubbedLocalServerPickerView(null) .Instance("instance") .SecurityType(SecurityType.SqlServerAuth) .UserName("tiestv") .Password("rocks!"); m_DefaultConnection = new Connection("instance", SecurityType.SqlServerAuth, "tiestv", "rocks!"); m_GetLocalInstances = m_Mocks.PartialMock <StubbedGetLocalInstances>(); }
public LocalServerPickerPage(LocalServerPickerView view, WizardPage nextPage, TestConnection testConnection, GetLocalInstances getLocalInstances) : base(nextPage) { m_View = view; m_TestConnection = testConnection; m_View.SetFormEnabledState(EnabledState.Integrated); UpdateViewWithLocalInstances(getLocalInstances); view.OnChange(OnChangeAction); }