public void Material_AdicionarNova_ValidarResultado() { var material = new Domain.Entities.Material("plástico"); var repo = new Mock <IMaterialRepository>(); repo.Setup(r => r.RetornarPorDescricao(material.Descricao)).Returns((Domain.Entities.Material)null); var materialValida = new MaterialAptaParaCadastroValidation(repo.Object); Assert.True(materialValida.Validate(material).IsValid); }
public void Material_DeveSerUnica_True() { var material = new Domain.Entities.Material("plástico"); var repo = new Mock <IMaterialRepository>(); repo.Setup(r => r.RetornarPorDescricao(material.Descricao)).Returns((Domain.Entities.Material)null); var materialSpecification = new MaterialDeveSerUnicaSpecification(repo.Object); Assert.True(materialSpecification.IsSatisfiedBy(material)); }