예제 #1
0
        public PriceCalculation GetPriceCalculation()
        {
            List <PriceItem>        priceItems = priceItemsService.GetAll();
            PriceCalculationsHelper priceCalculationsHelper = new PriceCalculationsHelper();
            PriceCalculation        priceCalculation        = priceCalculationsHelper.GetPriceCalculation(priceItems);

            return(priceCalculation);
        }
        public void GetMostExpensiveSixtyMinutesPeriodTest()
        {
            //Arrange
            string expected = "10/01/2013 02:00:00 to 10/01/2013 03:00:00";
            PriceCalculationsHelper priceCalculationsHelper = new PriceCalculationsHelper();

            //Act
            string actual = priceCalculationsHelper.GetMostExpensiveSixtyMinutesPeriod(priceItems);

            //Assert
            Assert.AreEqual(expected, actual);
        }
        public void GetAvgPriceTest()
        {
            //Arrange
            decimal expected = 47.27m;
            PriceCalculationsHelper priceCalculationsHelper = new PriceCalculationsHelper();

            //Act
            decimal actual = priceCalculationsHelper.GetAvgPrice(priceItems);

            //Assert
            Assert.AreEqual(expected, actual);
        }