} // TestPayments static void Main(string[] args) { SchemeResult schemeResult = new SchemeResult("ABC", new CoverSection("PRIMARY", 100.0)); schemeResult.AddCoverSection(new CoverSection("COV1", 10.0)); schemeResult.AddCoverSection(new CoverSection("COV2", 20.0)); schemeResult.AddCoverSection(new CoverSection("COV3", 30.0)); //// Test duplicate Cover Section exception //try //{ // schemeResult.AddCoverSection(new CoverSection("COV3", 40.0)); //} //catch (Exception eek) //{ // Console.WriteLine(eek.Message); //} Console.WriteLine(); Console.WriteLine("Scheme {0} : Premium {1}", schemeResult.Code, schemeResult.TotalPremium); Console.WriteLine(); Console.WriteLine("Primary Cover Section {0} : Full Premium = {1}", schemeResult.PrimaryCoverSection.Code, schemeResult.PrimaryCoverSection.Premium); foreach (CoverSection coverSectionOriginal in schemeResult.AdditionalCoverSectionContainer) { Console.WriteLine(" Additional Cover Section {0} : Full Premium {1}", coverSectionOriginal.Code, coverSectionOriginal.Premium); } TestPayments(schemeResult, 11); TestPayments(schemeResult, 12); }