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 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); }
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); }
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]); }
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); }
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); }
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); }
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_BlankRecords_ShouldGiveException() { var trendingCalculator = new Library.TrendsCalculator(); var inputData = DataPreparator.PrepareData_Suite4(); var output = trendingCalculator.FindTrendingData(6, 1, inputData, TrendCalculationStrategy.Custom); }
public void TrendsCalculatorTest_DemandSupplyCriteria_numberOfSegmentsOfEachUnitToBeZero_ShouldGiveException() { var trendingCalculator = new Library.TrendsCalculator(); var inputData = DataPreparator.PrepareDemandData_Suite1(); var output = trendingCalculator.FindTrendingData(6, 0, inputData); }
public void TrendsCalculatorTest_DemandSupplyCriteria_windowPeriodToBeZero_ShouldGiveException() { var trendingCalculator = new Library.TrendsCalculator(); var inputData = DataPreparator.PrepareDemandData_Suite1(); var output = trendingCalculator.FindTrendingData(0, 1, inputData); }
public void TrendsCalculatorTest_DemandSupplyCriteria_BlankRecords_ShouldGiveException() { var trendingCalculator = new Library.TrendsCalculator(); var inputData = DataPreparator.PrepareDemandData_Suite4(); var output = trendingCalculator.FindTrendingData(6, 1, inputData); }