public void VoegActieToeAfgekeurdeContainer() { _groep.CurrentState = new MotivatieGoedgekeurdState(_groep); var model = new ActieViewModel(); var container = new ActieContainer(); container.Beoordeeld = true; _groep.AddContainer(container); _controller.ActieMaken(_cursist); model.Titel = "Test"; model.Omschrijving = "Test"; _controller.VoegActieToe(_cursist, model); _actieRepository.Verify(a => a.SaveChanges(), Times.Once); }
public void MaakBericht_MaaktBerichtAan() { var model = new DeelActieViewModel(); _groep2.CurrentState = new MotivatieGoedgekeurdState(_groep); model.Id = 1; var container = new ActieContainer(); _groep2.AddContainer(container); var actie = new Actie("Test", "Actie"); container.VoegActieToe(actie); _actieRepository.Setup(c => c.GeefActie(1)).Returns(actie); _actieRepository.Setup(c => c.GetById(1)).Returns(actie); model.Aankodiging = "TestBeschrijving"; _controller.MaakBericht(_cursist2, model); _actieRepository.Verify(a => a.SaveChanges()); }
public ActieControllerTest() { _groepRepository = new Mock <IGroepRepository>(); _actieRepository = new Mock <IActieRepository>(); _cursistRepository = new Mock <ICursistRepository>(); _containerRepository = new Mock <IActieContainerRepository>(); _berichtRepository = new Mock <IBerichtRepository>(); _controller = new ActieController(_actieRepository.Object, _groepRepository.Object, _cursistRepository.Object, _containerRepository.Object, _berichtRepository.Object); _cursist = new Cursist("Fulvio", "Gentile", "*****@*****.**"); _groep = new Groep("G11", false); _cursist.Groep = _groep; _groep.VoegCursistToe(_cursist); _cursist2 = new Cursist("Robin", "Gammoudi", "*****@*****.**"); _groep2 = new Groep("G12", false); _cursist2.Groep = _groep2; _groep2.VoegCursistToe(_cursist2); _groep2.CurrentState = new MotivatieGoedgekeurdState(_groep); _groep2.AddContainer(new ActieContainer()); _groep2.VoegActieToe(new Actie("Testactie", "Testomschrijving")); _controller.DienActiesIn(_cursist2); }