示例#1
0
        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());
        }
示例#2
0
        public void IsValidoTestTrue()
        {
            CupomPotz cupompotz = new CupomPotz("500036532-7");

            Assert.IsTrue(cupompotz.isValido());
        }
示例#3
0
        public void IsValidoTestFalse()
        {
            CupomPotz cupompotz = new CupomPotz("500036532-8");

            Assert.IsFalse(cupompotz.isValido());
        }