コード例 #1
0
        public void TestTrendingCalculatorZMeanCriteria_ShouldRunSuccessfully_Suite1()
        {
            var trendingStrategy = new ZMeanTrendingCalculator();
            var inputData        = DataPreparator.PrepareData_Suite1();
            var output           = trendingStrategy.CalculateTrending <TestInputModel>(6, 1, inputData);

            Assert.AreEqual("ABC", output.First().First().item.MovieName);
        }
コード例 #2
0
        public void TestTrendingCalculatorDemandSupplyCriteria_ShouldRunSuccessfully_Suite2()
        {
            var trendingStrategy = new DemandSupplyTrendingCalculator();
            var inputData        = DataPreparator.PrepareDemandData_Suite2();
            var output           = trendingStrategy.CalculateTrending(6, 1, inputData);

            Assert.AreEqual("ABC", output[1].First().item.MovieName);
            Assert.AreEqual("PQR", output.Last().First().item.MovieName);
        }
コード例 #3
0
        public void TrendsCalculatorTest_CustomCriteria_ShouldRunSuccessfully_Suite2()
        {
            var trendingCalculator = new Library.TrendsCalculator();
            var inputData          = DataPreparator.PrepareData_Suite2();
            var output             = trendingCalculator.FindTrendingData(6, 1, inputData, TrendCalculationStrategy.Custom);

            Assert.AreEqual("ABC", output.First().MovieName);
            Assert.AreEqual("XYZ", output.ToList()[1].MovieName);
            Assert.AreEqual("PQR", output.ToList()[2].MovieName);
        }
コード例 #4
0
        public void TrendsCalculatorTest_ZMeanCriteria_ShouldRunSuccessfully_Suite2()
        {
            var trendingCalculator = new Library.TrendsCalculator();
            var inputData          = DataPreparator.PrepareData_Suite2();
            var output             = trendingCalculator.FindTrendingData(6, 1, inputData, TrendCalculationStrategy.ZMean);

            Assert.AreEqual("ABC", output.First().MovieName);
            Assert.ThrowsException <ArgumentOutOfRangeException>(() => output.ToList()[1]);
            Assert.ThrowsException <ArgumentOutOfRangeException>(() => output.ToList()[2]);
        }
コード例 #5
0
        public void TrendsCalculatorTest_DemandSupplyCriteria_ShouldRunSuccessfully_Suite1()
        {
            var trendingCalculator = new Library.TrendsCalculator();
            var inputData          = DataPreparator.PrepareDemandData_Suite1();
            var output             = trendingCalculator.FindTrendingData(6, 1, inputData);

            Assert.AreEqual("ABC", output.First().MovieName);
            Assert.AreEqual("XYZ", output.ToList()[1].MovieName);
            Assert.AreEqual("PQR", output.ToList()[2].MovieName);
        }
コード例 #6
0
 public void TrendsCalculatorTest_ZMeanCriteria_IncorrectData_ShouldGiveException()
 {
     var trendingCalculator = new Library.TrendsCalculator();
     var inputData          = DataPreparator.PrepareData_Suite3();
     var output             = trendingCalculator.FindTrendingData(6, 1, inputData, TrendCalculationStrategy.ZMean);
 }
コード例 #7
0
 public void TrendsCalculatorTest_CustomCriteria_numberOfSegmentsOfEachUnitToBeZero_ShouldGiveException()
 {
     var trendingCalculator = new Library.TrendsCalculator();
     var inputData          = DataPreparator.PrepareData_Suite4();
     var output             = trendingCalculator.FindTrendingData(6, 0, inputData, TrendCalculationStrategy.Custom);
 }
コード例 #8
0
 public void TrendsCalculatorTest_CustomCriteria_windowPeriodToBeZero_ShouldGiveException()
 {
     var trendingCalculator = new Library.TrendsCalculator();
     var inputData          = DataPreparator.PrepareData_Suite1();
     var output             = trendingCalculator.FindTrendingData(0, 1, inputData, TrendCalculationStrategy.Custom);
 }
コード例 #9
0
 public void TrendsCalculatorTest_BlankRecords_ShouldGiveException()
 {
     var trendingCalculator = new Library.TrendsCalculator();
     var inputData          = DataPreparator.PrepareData_Suite4();
     var output             = trendingCalculator.FindTrendingData(6, 1, inputData, TrendCalculationStrategy.Custom);
 }
コード例 #10
0
 public void TrendsCalculatorTest_DemandSupplyCriteria_numberOfSegmentsOfEachUnitToBeZero_ShouldGiveException()
 {
     var trendingCalculator = new Library.TrendsCalculator();
     var inputData          = DataPreparator.PrepareDemandData_Suite1();
     var output             = trendingCalculator.FindTrendingData(6, 0, inputData);
 }
コード例 #11
0
 public void TrendsCalculatorTest_DemandSupplyCriteria_windowPeriodToBeZero_ShouldGiveException()
 {
     var trendingCalculator = new Library.TrendsCalculator();
     var inputData          = DataPreparator.PrepareDemandData_Suite1();
     var output             = trendingCalculator.FindTrendingData(0, 1, inputData);
 }
コード例 #12
0
 public void TrendsCalculatorTest_DemandSupplyCriteria_BlankRecords_ShouldGiveException()
 {
     var trendingCalculator = new Library.TrendsCalculator();
     var inputData          = DataPreparator.PrepareDemandData_Suite4();
     var output             = trendingCalculator.FindTrendingData(6, 1, inputData);
 }