Exemplo n.º 1
0
        public Producto(Ean codigo, string descripcion, Importe precio)
        {
            if (codigo == null)
            {
                throw new ArgumentNullException();
            }
            if (descripcion == null)
            {
                throw new ArgumentNullException();
            }
            if (descripcion.Length < 1)
            {
                throw new ArgumentException();
            }
            if (precio == null)
            {
                throw new ArgumentNullException();
            }

            Codigo      = codigo;
            Descripcion = descripcion;
            Precio      = precio;
        }
Exemplo n.º 2
0
 public bool Equals(Importe otro) => otro?.valor.Equals(valor) ?? false;
Exemplo n.º 3
0
 public Importe Sumar(Importe importe) => new Importe(valor + importe.valor);