public void VerwijderActie() { _groep.CurrentState = new MotivatieGoedgekeurdState(_groep); var model = new VerwijderActieModel(); model.actieId = 1; var container = new ActieContainer(); _groep.AddContainer(container); var actie = new Actie("Test", "Actie"); container.VoegActieToe(actie); _actieRepository.Setup(c => c.GetById(1)).Returns(actie); var result = _controller.VerWijderActie(_cursist, model); var redirect = result as ViewResult; _actieRepository.Verify(a => a.SaveChanges(), Times.Once); Assert.Equal("MaakActie", redirect?.ViewName); }
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 VoegActieToeMetContainer() { _groep.CurrentState = new MotivatieGoedgekeurdState(_groep); var model = new ActieViewModel(); var container = new ActieContainer(); _groep.AddContainer(container); _controller.ActieMaken(_cursist); model.Titel = "Test"; model.Omschrijving = "Test"; _controller.VoegActieToe(_cursist, model); _actieRepository.Verify(a => a.SaveChanges(), Times.Once); Assert.Equal(container, _groep.GeefLaatsteContainer()); }
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 void MaakBericht_ReturntIndex() { 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); var result = _controller.ActieMaken(_cursist); var action = result as RedirectToActionResult; Assert.Equal("Index", action?.ActionName); }
public void UpdateContainer(ActieContainer actieContainer) { _containers.Add(actieContainer); }
public void AddContainer(ActieContainer actieContainer) { _containers.Add(actieContainer); }