本文整理汇总了C#中OpenCBS.CoreDomain.Contracts.Savings.SavingBookContract.PostingInterests方法的典型用法代码示例。如果您正苦于以下问题:C# SavingBookContract.PostingInterests方法的具体用法?C# SavingBookContract.PostingInterests怎么用?C# SavingBookContract.PostingInterests使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenCBS.CoreDomain.Contracts.Savings.SavingBookContract
的用法示例。
在下文中一共展示了SavingBookContract.PostingInterests方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PostingInterests_NoPosting
public void PostingInterests_NoPosting()
{
// Assert.Ignore();
SavingsBookProduct product = new SavingsBookProduct
{
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfYear,
Periodicity = new InstallmentType("Yearly", 0, 12)
};
SavingBookContract saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
new User(),
new DateTime(2009, 01, 01),
null)
{
Product = product,
InterestRate = 0.1,
NextMaturity = new DateTime(2009, 01, 01)
};
List<SavingInterestsPostingEvent> list = new List<SavingInterestsPostingEvent>();
list = saving.PostingInterests(new DateTime(2009, 02, 01), new User { Id = 1 });
Assert.AreEqual(list.Count, 0);
}
示例2: PostingInterests_OnePosting
public void PostingInterests_OnePosting()
{
SavingsBookProduct product = new SavingsBookProduct
{
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfDay,
Periodicity = new InstallmentType("Daily", 1, 0)
};
SavingBookContract saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
new User(),
new DateTime(2009, 01, 01), null)
{
Product = product,
InterestRate = 0.1
};
saving.NextMaturity = saving.CreationDate;
List<SavingInterestsPostingEvent> list = new List<SavingInterestsPostingEvent>();
list = saving.PostingInterests(
saving.NextMaturity.Value,
new User { Id = 1 }
);
Assert.AreEqual(1, list.Count);
}
示例3: PostingInterests_OnePosting
public void PostingInterests_OnePosting()
{
SavingsBookProduct product = new SavingsBookProduct
{
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfYear
};
SavingBookContract saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
new User(),
new DateTime(2009, 01, 01),
null)
{
Product = product,
InterestRate = 0.1
};
List<SavingInterestsPostingEvent> list = new List<SavingInterestsPostingEvent>();
list = saving.PostingInterests(new DateTime(2010, 01, 01), new User { Id = 1 });
Assert.AreEqual(list.Count, 1);
}
示例4: PostingInterests_TenPosting
public void PostingInterests_TenPosting()
{
// Assert.Ignore();
SavingsBookProduct product = new SavingsBookProduct
{
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfDay,
Periodicity = new InstallmentType("Daily", 1, 0)
};
DateTime postingDate = new DateTime(2009, 01, 10);
SavingBookContract saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
new User(),
new DateTime(2009, 01, 01),
null)
{
Product = product,
InterestRate = 0.1,
NextMaturity = new DateTime(2009, 01, 01)
};
List<SavingInterestsPostingEvent> list = new List<SavingInterestsPostingEvent>();
List<SavingInterestsAccrualEvent> savingInterestsAccrualEvents = saving.CalculateInterest(
new DateTime(2009, 01, 10),
new User {Id = 1});
foreach (SavingInterestsAccrualEvent accrualEvent in savingInterestsAccrualEvents)
{
saving.Events.Add(accrualEvent);
}
saving.NextMaturity = saving.CreationDate.AddDays(-1);
while (
DateCalculationStrategy.GetNextMaturity(saving.NextMaturity.Value, saving.Product.Periodicity, 1)
<=
postingDate)
{
saving.NextMaturity = DateCalculationStrategy.GetNextMaturity(saving.NextMaturity.Value,
saving.Product.Periodicity, 1);
list.AddRange(saving.PostingInterests(saving.NextMaturity.Value, new User { Id = 1 }));
foreach (var postingEvent in list)
{
saving.Events.Add(postingEvent);
}
list.Clear();
}
Assert.AreEqual(10, saving.Events.FindAll(item =>item is SavingInterestsPostingEvent).Count);
}
示例5: PostingInterests_OnePosting
public void PostingInterests_OnePosting()
{
SavingsBookProduct product = new SavingsBookProduct
{
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfWeek,
Periodicity = new InstallmentType("Weekly", 7, 0)
};
User user = new User(){Id=1};
SavingBookContract saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
user,
new DateTime(2009, 01, 01),
null)
{
Product = product, InterestRate = 0.1
};
saving.NextMaturity = saving.GetNextMaturity(saving.CreationDate, saving.Periodicity);
saving.FirstDeposit(1000, saving.CreationDate, 0, user, new Teller());
List<SavingInterestsPostingEvent> list = new List<SavingInterestsPostingEvent>();
List<SavingInterestsPostingEvent> postingEvents = new List<SavingInterestsPostingEvent>();
DateTime closureDate = new DateTime(2009, 01, 05);
List<SavingInterestsAccrualEvent> accrualEvents = saving.CalculateInterest(closureDate, user);
foreach (var accrualEvent in accrualEvents)
{
saving.Events.Add(accrualEvent);
}
list = saving.PostingInterests(saving.NextMaturity.Value, user);
postingEvents.AddRange(list);
foreach (var postingEvent in list)
{
saving.Events.Add(postingEvent);
}
Assert.AreEqual( 1, postingEvents.Count);
}
示例6: PostingInterests_12Posting
public void PostingInterests_12Posting()
{
// Assert.Ignore();
SavingsBookProduct product = new SavingsBookProduct
{
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfMonth,
Periodicity = new InstallmentType("Monthly", 0, 1)
};
User user = new User() {Id = 1};
DateTime creationDate = new DateTime(2009, 01, 01);
SavingBookContract saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
user,
creationDate,
null
)
{
Product = product,
InterestRate = 0.1
};
DateTime closureDate = new DateTime(2010, 01, 01);
saving.NextMaturity = saving.CreationDate.Date;
saving.NumberOfPeriods = 1;
saving.FirstDeposit(1000, creationDate, 0, user, new Teller());
saving.NextMaturity = DateCalculationStrategy.GetNextMaturity(
saving.CreationDate.Date,
saving.Product.Periodicity,
saving.NumberOfPeriods);
List<SavingInterestsAccrualEvent> interestsAccrualEvents =
saving.CalculateInterest(closureDate, new User {Id = 1});
foreach (var accrualEvent in interestsAccrualEvents)
{
saving.Events.Add(accrualEvent);
}
List<SavingInterestsPostingEvent> list = new List<SavingInterestsPostingEvent>();
List<SavingInterestsPostingEvent> postingEvents = new List<SavingInterestsPostingEvent>();
while (saving.NextMaturity.Value <= closureDate)
{
list = saving.PostingInterests(saving.NextMaturity.Value, new User() {Id = 1});
postingEvents.AddRange(list);
foreach (var postingEvent in list)
{
saving.Events.Add(postingEvent);
}
saving.NextMaturity = DateCalculationStrategy.GetNextMaturity(saving.NextMaturity.Value, saving.Periodicity, 1);
}
list = saving.PostingInterests(new DateTime(2010, 01, 01), new User { Id = 1 });
Assert.AreEqual(12, postingEvents.Count);
}
示例7: PostingInterests_OnePosting
public void PostingInterests_OnePosting()
{
SavingsBookProduct product = new SavingsBookProduct
{
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfMonth,
Periodicity = new InstallmentType("Monthly",0,1)
};
User user = new User() { Id = 1 };
DateTime closureDate = new DateTime(2009, 02, 01);
SavingBookContract saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
user,
new DateTime(2009, 01, 01),
null
)
{
Product = product,
InterestRate = 0.1
};
saving.NextMaturity = DateCalculationStrategy.GetNextMaturity(saving.CreationDate.Date,
saving.Periodicity, 1);
List<SavingInterestsAccrualEvent> savingInterestsAccrualEvents =
saving.CalculateInterest(closureDate, user);
foreach (var accrualEvent in savingInterestsAccrualEvents)
{
saving.Events.Add(accrualEvent);
}
List<SavingInterestsPostingEvent> list = new List<SavingInterestsPostingEvent>();
list = saving.PostingInterests(closureDate, user);
Assert.AreEqual(1, list.Count);
}