public void Excluir_AnuncioEmStatusQueNaoPodemSerExcluido_DomainException() { foreach (var status in Status.GetAll()) { if (status.PodeSerExcluido()) { continue; } // Arrange var anuncio = AnuncioFakeFactory.CriarAnuncioPorStatus(status); // Act // Assert Assert.Throws <DomainException>(() => anuncio.Excluir()); } }
public void Excluir_AnuncioEmStatusQuePodemSerExcluido_AnuncioExcluido() { foreach (var status in Status.GetAll()) { if (!status.PodeSerExcluido()) { continue; } // Arrange var anuncio = AnuncioFakeFactory.CriarAnuncioPorStatus(status); // Act anuncio.Excluir(); // Assert Assert.True(anuncio.Status.EhExcluido()); } }