Example #1
0
 public void HandleVerifyConnectionCommand(ISettings settings)
 {
     try {
         var versionOneSettings = CreateVersionOneSettings(settings);
         DataLayer.CheckConnection(versionOneSettings);
         view.ShowMessage("Login Successful!", "Test Connection");
     } catch (DataLayerException ex) {
         view.ShowErrorMessage(ex.Message, "Test Connection");
     }
 }
        public void VerifyConnection()
        {
            Expect.Call(viewMock.Controller).PropertyBehavior().IgnoreArguments();
            Expect.Call(viewMock.Model).PropertyBehavior().IgnoreArguments();
            Expect.Call(() => eventDispatcherMock.ModelChanged += null).IgnoreArguments();
            Expect.Call(() => dataLayerMock.CheckConnection(null)).IgnoreArguments();
            Expect.Call(() => viewMock.ShowMessage(null, null)).IgnoreArguments();

            MockRepository.ReplayAll();

            controller.RegisterView(viewMock);
            controller.PrepareView();
            controller.Prepare();
            controller.HandleVerifyConnectionCommand(settingsStub);

            MockRepository.VerifyAll();
        }