Example #1
0
        public void GetMinAndMaxValueTest()
        {
            IGetStockValues obj  = new GetStockValues();
            var             vals = obj.GetMaxGain();

            Assert.IsNotNull(vals);
        }
Example #2
0
 protected void ddlDataSampleFiles_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlDataSampleFiles.SelectedIndex > 0 && !string.IsNullOrEmpty(ddlDataSampleFiles.SelectedValue))
     {
         IGetStockValues stockVals   = new GetStockValues(ddlDataSampleFiles.SelectedValue);
         var             maxGainDays = stockVals.GetMaxGain();
         if (maxGainDays != null && maxGainDays.Count > 0)
         {
             var buySellDays = maxGainDays.FirstOrDefault();
             lblResults.Text =
                 string.Format(
                     " Buy Day: {0} , Buy Value: {1} , Sell Day: {2} ,Sell Value: {3} for maximum profit.",
                     buySellDays.BuyDay, buySellDays.BuyValue.ToString("c"), buySellDays.SellDay, buySellDays.SellValue.ToString("c"));
         }
     }
 }