public void Update_ShouldUpdateBevestigdeBestelling_When_AnUpdatedBevestigdeBestelling_IsGiven() { // Arrange BevestigdeBestelling bevestigdeBestelling = new BevestigdeBestellingBuilder().SetDummy().Create(); BevestigdeBestelling bevestigdeBestellingUpdate = bevestigdeBestelling; bevestigdeBestellingUpdate.BestelStatus = BestelStatus.Goedgekeurd; _target.Insert(bevestigdeBestelling); // Act _target.Update(bevestigdeBestellingUpdate); BevestigdeBestelling result = _target.GetByFactuurnummer(bevestigdeBestellingUpdate.Factuurnummer); // Assert Assert.IsNotNull(result); Assert.IsTrue(result.IsEqual(bevestigdeBestellingUpdate)); }
public void Update_ShouldUpdateBestelling_When_AnUpdatedBestelling_IsGiven() { // Arrange Bestelling bestelling = new BestellingBuilder().SetDummy().Create(); Bestelling bestellingUpdate = bestelling; bestellingUpdate.BestelStatus = BestelStatus.Goedgekeurd; var dataMapper = new BestellingDataMapper(_context); dataMapper.Insert(bestelling); // Act dataMapper.Update(bestellingUpdate); Bestelling result = dataMapper.GetByFactuurnummer(bestellingUpdate.Factuurnummer); // Assert Assert.IsNotNull(result); Assert.IsTrue(result.IsEqual(bestellingUpdate)); }
public void Update_ShouldNotUpdateArtikelInDatabase_When_NoFactuurNummer_IsGiven() { // Arrange Bestelling bestelling = new BestellingBuilder() .SetBesteldatum(DateTime.Now) .SetBestelStatus(BestelStatus.Geplaatst) .SetKlantnummer(1) .Create(); _context.Bestellingen.Add(bestelling); var dataMapper = new BestellingDataMapper(_context); // Act void Act() { dataMapper.Update(bestelling); } // Assert Assert.ThrowsException <ArgumentNullException>((Action)Act); }
public void NotImplementedMethods_ShouldThrowNotImplementedException() { Assert.ThrowsException <NotImplementedException>(() => _target.GetById(1)); Assert.ThrowsException <NotImplementedException>(() => _target.Delete(new Bestelling())); Assert.ThrowsException <NotImplementedException>(() => _target.Update(new Bestelling())); }