public void Delete_Should_Throw_InvalidOperationException() { // Arrange BevestigdeBestelling bevestigdeBestelling = new BevestigdeBestellingBuilder().SetDummy().Create(); // Act void Act() { _target.Delete(bevestigdeBestelling); } // Assert var exception = Assert.ThrowsException <InvalidOperationException>((Action)Act); Assert.AreEqual("Deleting a bestelling is not allowed.", exception.Message); }
public void Delete_Should_Throw_InvalidOperationException() { // Arrange Bestelling bestelling = new BestellingBuilder().SetDummy().Create(); var dataMapper = new BestellingDataMapper(_context); // Act void Act() { dataMapper.Delete(bestelling); } // Assert var exception = Assert.ThrowsException <InvalidOperationException>((Action)Act); Assert.AreEqual("Deleting bestelling is not allowed", exception.Message); }
public void NotImplementedMethods_ShouldThrowNotImplementedException() { Assert.ThrowsException <NotImplementedException>(() => _target.GetById(1)); Assert.ThrowsException <NotImplementedException>(() => _target.Delete(new Bestelling())); Assert.ThrowsException <NotImplementedException>(() => _target.Update(new Bestelling())); }