Example #1
0
 public void PLUSMaxReturnRipperWorks()
 {
     foreach (var testPair in _expectedUpsideLeverageData)
     {
         string testFilePath = testPair.Key;
         Debug.WriteLine("TestPLUSUpsideLeverageRipper testing file: " + testFilePath);
         string     textToParse     = GeneralUtils.GetStringFromTextFile(testFilePath);
         PLUSRipper ripper          = DealRipperFactory.GetPLUSRipper(textToParse);
         decimal    trueMaxReturn   = (decimal)testPair.Value;
         decimal    rippedMaxReturn = ripper.GetMaxReturn();
         Assert.AreEqual(trueMaxReturn, rippedMaxReturn);
     }
 }
Example #2
0
 protected virtual void parse(PLUSContainer container, PLUSRipper ripper)
 {
     base.parse(container, ripper);
     try
     {
         container.UpsideIsCapped = ripper.GetWhetherUpsideIsCapped();
         if (container.UpsideIsCapped)
         {
             container.MaxReturn = ripper.GetMaxReturn();
         }
         container.UpsideLeverage = ripper.GetUpsideLeverage();
     }
     catch (DetailParsingException)
     {
         throw;
     }
     catch (Exception e)
     {
         string errorMsg = "Unrecognized exception encountered in PLUSFactory parse() method.";
         Debug.WriteLine(errorMsg);
         throw new DealFactoryException(errorMsg, e);
     }
 }