示例#1
0
        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());
            }
        }
示例#2
0
        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());
            }
        }