public void InitialisationDuPresenter() { FakeDetailAnnonceVue vue = new FakeDetailAnnonceVue(); DetailAnnoncePresenter presenter = new DetailAnnoncePresenter(vue, repository.Object); Assert.AreEqual(vue, presenter.Vue); }
public void ChangeLEtatDeFavoriDUneAnnonce() { IDetailAnnonceView fake = new FakeDetailAnnonceVue(); Annonce annonce = Helper.Annonce.CreateWithValues(); repository.Setup(repo => repo.AjouteOuMetAJour(annonce)).Verifiable(); annonce.Favori = false; DetailAnnoncePresenter presenter = new DetailAnnoncePresenter(fake, repository.Object); presenter.AfficheLeDétailDUneAnnonce(annonce); presenter.AjouterAuxFavoris(null, null); Assert.AreEqual(true, annonce.Favori); Assert.AreEqual(fake.FavoriAnnonce, true); presenter.AjouterAuxFavoris(null, null); Assert.AreEqual(false, annonce.Favori); Assert.AreEqual(fake.FavoriAnnonce, false); repository.Verify(repo => repo.AjouteOuMetAJour(annonce), Times.Exactly(2)); }
public void Initialize() { Vue = new FakeDetailAnnonceVue(); Repository = new Mock<IAnnonceRepository>(); }