public void PutsJiraUriFromPreferencesIntoView()
        {
            _preferences.GetPreferences()
            .Returns(new Preferences {
                JiraUri = new Uri("http://somejira.atlassian.net")
            });

            //

            _presenter.Initialize(_view);

            //

            _view.Received().JiraUrl = "http://somejira.atlassian.net/";
        }
 public ActionResult Create(long?id)
 {
     if (id == null)
     {
         //  ViewBag.IdDossier = new SelectList(GEN_Dossiers.Where(e => e.Actif), "Id", "CodeDossier");
         ViewBag.IdDossier = new SelectList(dossiersService.GetActifDossier(), "DossierId", "CodeDossier");
         return(View());
     }
     else
     {
         // GEN_Devises gEN_Devises = db.GEN_Devises.Find(id);
         var preference = preferencesServise.GetPreferences((int)id);
         if (preference == null)
         {
             TempData["errorMessage"] = "Le exercice que vous cherchez n'existe pas.";
             return(RedirectToAction("Index"));
         }
         PreferencesFormViewModel peroidFormModel = Mapper.Map <PreferencesPivot, PreferencesFormViewModel>(preference);
         return(View(peroidFormModel));
     }
 }
        public void Initialize(IEditPreferencesView view)
        {
            var preferences = _preferences.GetPreferences();

            view.JiraUrl = preferences.JiraUri?.ToString();
            view.DisplayHasCredentials = preferences.LoginCookies.Count > 0;

            view.JiraLoginButtonClicked      += (sender, e) => ShowJiraLoginView(view, preferences);
            view.SaveButtonClicked           += (sender, e) => SavePreferences(view, preferences);
            view.CancelButtonClicked         += (sender, e) => view.Close();
            view.LoadDashboardsButtonClicked += async(sender, e) => await LoadJiraDashboards(view, preferences);
        }