示例#1
0
 public Bond(BondCoupon coupon, decimal faceValue, Currency currency, DateTime issueDate, DateTime maturityDate)
 {
     Coupon       = coupon;
     FaceValue    = faceValue;
     IssueDate    = issueDate;
     MaturityDate = maturityDate;
     Currency     = currency;
     CurrencyId   = currency.Id;
 }
示例#2
0
        public void SetCoupon(decimal amount, decimal rate)
        {
            if (rate < 0 || rate > 1)
            {
                throw new ValidationException("Rate cannot be smaller than 0 or larger than 1");
            }

            if (amount <= 0)
            {
                throw new ValidationException("Amount cannot be negative");
            }

            Coupon = new BondCoupon
            {
                Rate   = rate,
                Amount = amount
            };
        }