public void Generate_XIsFirstRootOfFirstNumberGenerator_ThrowsInvalidOperationException()
        {
            var payload = new SeriesPayLoad(-60.49590136, 1250.0);

            var generator = new SeriesGeneratorFacade();

            generator.Generate(payload, 5).ToList();
        }
        public void Generate_Length5_FirstNumberShouldBeSetToFirstNumberRounded()
        {
            var generator = new SeriesGeneratorFacade();

            var series = generator.Generate(TestPayLoad, 5).ToList();

            var firstNumber = series.ElementAt(0);

            Assert.AreEqual(1.5, firstNumber);
        }
        public void Generate_Length5_ShouldGenerateFiveNumbers()
        {
            var generator = new SeriesGeneratorFacade();

            var series = generator.Generate(TestPayLoad, 5);

            DiagnoseSeries(series);
            Assert.IsNotNull(series);
            Assert.AreEqual(5, series.Count());
        }
        public void Generate_Lenght0_ShouldGenerateEmptySeries()
        {
            var generator = new SeriesGeneratorFacade();

            var series = generator.Generate(TestPayLoad, 0);

            DiagnoseSeries(series);
            Assert.IsNotNull(series);
            Assert.IsFalse(series.Any());
        }
        public void Generate_Length5_ShouldGenerateNumbersRounded()
        {
            var generator = new SeriesGeneratorFacade();

            var series = generator.Generate(TestPayLoad, 5).ToList();

            DiagnoseSeries(series);
            Assert.AreEqual(1.5, series[0]);
            Assert.AreEqual(4, series[1]);
            Assert.AreEqual(6.5, series[2]);
            Assert.AreEqual(10.75, series[3]);
            Assert.AreEqual(17.25, series[4]);
        }
Пример #6
0
 public SpecialNumberFinder(SeriesGeneratorFacade generator, double approximateNumberConstant)
 {
     _generator = generator;
     _approximateNumberConstant = approximateNumberConstant;
 }
        public void Generate_XIsSecondRootOfFirstNumberGenerator_ThrowsInvalidOperationException()
        {
            var payload = new SeriesPayLoad(-58.80972058, 1250.0);

            var generator = new SeriesGeneratorFacade();

            generator.Generate(payload, 5).ToList();
        }
        public void Generate_XGeneratesLessThanOneForFirstNumber_SeriesShouldBeSorted()
        {
            var payload = new SeriesPayLoad(-59, 1250.0);

            var generator = new SeriesGeneratorFacade();

            var series = generator.Generate(payload, 5).ToList();

            DiagnoseSeries(series);
            Assert.IsTrue(series[0] < series[1]);
        }