public void NotReadyToMoveIfInstanceNotSelected()
        {
            Given();
            var view = new StubbedLocalServerPickerView(null)
                .Instance(null);

            When();
            var localServerPickerPage = new LocalServerPickerPage(view, null, null, m_GetLocalInstances);
            var readyToMove = localServerPickerPage.ReadyToMove();

            Then();
            Assert.That(readyToMove, Is.False);
        }
Пример #2
0
        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>();
        }
Пример #3
0
        public void NotReadyToMoveIfInstanceNotSelected()
        {
            Given();
            var view = new StubbedLocalServerPickerView(null)
                       .Instance(null);


            When();
            var localServerPickerPage = new LocalServerPickerPage(view, null, null, m_GetLocalInstances);
            var readyToMove           = localServerPickerPage.ReadyToMove();

            Then();
            Assert.That(readyToMove, Is.False);
        }
Пример #4
0
        public void ReadyToMoveIfInstanceSelectedAndUsingIntegratedSecurity()
        {
            Given();
            var view = new StubbedLocalServerPickerView(null)
                       .Instance("something");

            view.SecurityType(SecurityType.Integrated);

            When();
            var localServerPickerPage = new LocalServerPickerPage(view, null, null, m_GetLocalInstances);
            var readyToMove           = localServerPickerPage.ReadyToMove();

            Then();
            Assert.That(readyToMove, Is.True);
        }
        public void NotReadyToMoveIfUsernameNotSupplied()
        {
            Given();
            var view =
                new StubbedLocalServerPickerView(null)
                    .Instance("soemthingelseelse")
                    .SecurityType(SecurityType.SqlServerAuth)
                    .Password("rocks");

            When();
            var localServerPickerPage = new LocalServerPickerPage(view, null, null, m_GetLocalInstances);
            var readyToMove = localServerPickerPage.ReadyToMove();

            Then();
            Assert.That(readyToMove, Is.False);
        }
Пример #6
0
        public void ShouldReturnWidgetAndNextPageAndFormIsEnabledAndRegisterForEvents()
        {
            Given();
            var widget   = new UserControl();
            var view     = new StubbedLocalServerPickerView(widget);
            var nextPage = new StubbedPage(null, null, null, null);

            When();
            var localServerPickerPage = new LocalServerPickerPage(view, nextPage, null, m_GetLocalInstances);

            Then();
            Assert.That(view.FormEnabled, Is.EqualTo(EnabledState.Integrated));
            Assert.That(view.OnChangeAction, Is.Not.Null);
            Assert.That(localServerPickerPage.GetControl(), Is.EqualTo(widget));
            Assert.That(localServerPickerPage.GetNextPage(), Is.EqualTo(nextPage));
        }
Пример #7
0
        public void NotReadyToMoveIfUsernameNotSupplied()
        {
            Given();
            var view =
                new StubbedLocalServerPickerView(null)
                .Instance("soemthingelseelse")
                .SecurityType(SecurityType.SqlServerAuth)
                .Password("rocks");

            When();
            var localServerPickerPage = new LocalServerPickerPage(view, null, null, m_GetLocalInstances);
            var readyToMove           = localServerPickerPage.ReadyToMove();

            Then();
            Assert.That(readyToMove, Is.False);
        }
Пример #8
0
        public void ReadyToMoveIfInstanceSelectedUsingSqlAuthAndUserPasswordProvided()
        {
            Given();
            var view =
                new StubbedLocalServerPickerView(null)
                .Instance("soemthingelse")
                .SecurityType(SecurityType.SqlServerAuth)
                .UserName("tiest")
                .Password("rocks");

            When();
            var localServerPickerPage = new LocalServerPickerPage(view, null, null, m_GetLocalInstances);
            var readyToMove           = localServerPickerPage.ReadyToMove();

            Then();
            Assert.That(readyToMove, Is.True);
        }
        public void ShouldReturnWidgetAndNextPageAndFormIsEnabledAndRegisterForEvents()
        {
            Given();
            var widget = new UserControl();
            var view = new StubbedLocalServerPickerView(widget);
            var nextPage = new StubbedPage(null, null, null, null);

            When();
            var localServerPickerPage = new LocalServerPickerPage(view, nextPage, null, m_GetLocalInstances);

            Then();
            Assert.That(view.FormEnabled, Is.EqualTo(EnabledState.Integrated));
            Assert.That(view.OnChangeAction, Is.Not.Null);
            Assert.That(localServerPickerPage.GetControl(), Is.EqualTo(widget));
            Assert.That(localServerPickerPage.GetNextPage(), Is.EqualTo(nextPage));
        }
        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 void ReadyToMoveIfInstanceSelectedUsingSqlAuthAndUserPasswordProvided()
        {
            Given();
            var view =
                new StubbedLocalServerPickerView(null)
                    .Instance("soemthingelse")
                    .SecurityType(SecurityType.SqlServerAuth)
                    .UserName("tiest")
                    .Password("rocks");

            When();
            var localServerPickerPage = new LocalServerPickerPage(view, null, null, m_GetLocalInstances);
            var readyToMove = localServerPickerPage.ReadyToMove();

            Then();
            Assert.That(readyToMove, Is.True);
        }
        public void ReadyToMoveIfInstanceSelectedAndUsingIntegratedSecurity()
        {
            Given();
            var view = new StubbedLocalServerPickerView(null)
                .Instance("something");
            view.SecurityType(SecurityType.Integrated);

            When();
            var localServerPickerPage = new LocalServerPickerPage(view, null, null, m_GetLocalInstances);
            var readyToMove = localServerPickerPage.ReadyToMove();

            Then();
            Assert.That(readyToMove, Is.True);
        }