public ActionResult InserirPotz(Potz potz) { CupomPotz cupompotz = new CupomPotz(potz.numeroCupom); if (potz.numeroCupom != null) { if (cupompotz.isValido()) { cupompotz.quantidadePotz(); ViewBag.Valor = "Você recebeu " + cupompotz.getPotz() + " potz!"; } else { ViewBag.Valor = "Cupom Inválido"; } } return(View()); }
public void IsValidoTestTrue() { CupomPotz cupompotz = new CupomPotz("500036532-7"); Assert.IsTrue(cupompotz.isValido()); }
public void IsValidoTestFalse() { CupomPotz cupompotz = new CupomPotz("500036532-8"); Assert.IsFalse(cupompotz.isValido()); }