public AuthorisationModel(IAuthorisationView authorisationView, IWizard wizard) { this.wizard = wizard; // register events and handlers this.authorisationView = authorisationView; //register new subscription event handler with event authorisationView.RegisterNewSubscription(NewSubscriptionHandler); //register new certificate handler with new event authorisationView.RegisterNewCertificate(NewCertificateHandler); //register new changed SID selection handler authorisationView.RegisterChangedSIDSelection(ChangedSIDSelectionHandler); //register for changes to selection of the certificates on the ui. authorisationView.RegisterChangedCertificateSelection(ChangedCertificateSelectionHandler); //register for create button click authorisationView.RegisterCreate(CreateButtonHandler); //register password changed handler authorisationView.RegisterCertificatePasswordChanged(CertficatePasswordChanged); ITabNavigation genericPanel = CastITabNavigation(authorisationView); genericPanel.RegisterNext(NextHandler,TabNumber); // set up display on the view if there are SID's to show if (wizard.GetSIDList() != null && wizard.GetCertList() != null) { authorisationView.DisplaySubsriptions(wizard.GetSIDList()); authorisationView.DisplayCertificates(wizard.GetCertList()); authorisationView.DisableCreate(); authorisationView.EnableNext(); } }
public AuthorisationModel(IAuthorisationView authorisationView) { this.authorisationView = authorisationView; // register eventhandlers with UI ITabNavigation genericTabPanel = CastITabNavigation(authorisationView); genericTabPanel.RegisterNext(NextHandler,TabNumber); }
protected override IViewError castToIViewError(IAuthorisationView authorisationView) { return mockErrorView; }
public override ITabNavigation CastITabNavigation(IAuthorisationView view) { ITabNavigation mock = MockRepository.GenerateStub<ITabNavigation>(); mock.Stub(x => x.RegisterNext(Arg<EventHandler>.Is.Anything,Arg<int>.Is.Anything)); return mock; }
public OverRiddenAuthorisationModel_1(IAuthorisationView view, IWizard w, CertificateMaker mockMaker, FileWriter mockWriter, X509Store mockStore) : base(view, w) { this.mockMaker = mockMaker; this.mockWriter = mockWriter; this.mockStore = mockStore; }
public OverRiddenAuthorisationModel_1(IAuthorisationView view, IWizard w, IViewError mockErrorView) : base(view, w) { this.mockErrorView = mockErrorView; }
public OverRiddenAuthorisationModel_1(IAuthorisationView view, IWizard w, CertificateManager mockManager,IViewError mockErrorView) : base(view, w) { this.mockManager = mockManager; this.mockErrorView = mockErrorView; }
public OverRiddenAuthorisationModel_1(IAuthorisationView view, IWizard w) : base(view, w) { }
/// <summary> /// This method exists to allow injection of sata during testing /// </summary> /// <param name="authorisationView"></param> /// <returns></returns> protected virtual IViewError castToIViewError(IAuthorisationView authorisationView) { return (IViewError)authorisationView; }
// similar to a factory method, this allows a mocked tabNavigationObject to be injected while testing. public virtual ITabNavigation CastITabNavigation(IAuthorisationView authorisationView) { return (ITabNavigation)authorisationView; }