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); }
public void TrendsCalculatorTest_ZMeanCriteria_ShouldRunSuccessfully_Suite1() { var trendingCalculator = new Library.TrendsCalculator(); var inputData = DataPreparator.PrepareData_Suite1(); 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]); }
public void TrendsCalculatorTest_CustomCriteria_ShouldRunSuccessfully_Suite1() { var trendingCalculator = new Library.TrendsCalculator(); var inputData = DataPreparator.PrepareData_Suite1(); 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); }
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); }
public void TrendsCalculatorTest_ZMeanCriteria_numberOfSegmentsOfEachUnitToBeZero_ShouldGiveException() { var trendingCalculator = new Library.TrendsCalculator(); var inputData = DataPreparator.PrepareData_Suite1(); var output = trendingCalculator.FindTrendingData(6, 0, inputData, TrendCalculationStrategy.ZMean); }