Exemplo n.º 1
0
        public Bolao Update(Bolao bolao)
        {
            if (bolao.id <= 0)
            {
                throw new IdentifierUndefinedException();
            }

            bolao.Validate();
            return(_repository.Update(bolao));
        }
        public void Bolao_TestDomain_EmptyList_ShouldBeFail()
        {
            Bolao bolao = ObjectMother.GetBolao(_listApostas);

            bolao._Aposta = new List <Aposta>();

            Action comparation = () => bolao.Validate();

            comparation.Should().Throw <BolaoListApostasEmptyException>();
        }
        public void Bolao_TestDomain_ShouldBeOk()
        {
            Bolao bolao = ObjectMother.GetBolao(_listApostas);

            bolao.QtdApostas = 2;
            bolao.GetValorTotal();

            Action comparation = () => bolao.Validate();

            comparation.Should().NotThrow();
        }
Exemplo n.º 4
0
 public Bolao Add(Bolao bolao)
 {
     bolao.Validate();
     return(_repository.Save(bolao));
 }