Exemplo n.º 1
0
 private IEnumerable <Point> GetNextPointManyTimes(EternityGeneratorCirclePoints generatorCirclePoints, int countPoints)
 {
     for (var index = 0; index < countPoints; index++)
     {
         yield return(generatorCirclePoints.GetNextPoint());
     }
 }
Exemplo n.º 2
0
        public void GetNextPoint_ShouldReturnCenterPoint_WhenExecutesAtFirst(int x, int y)
        {
            var centerPoint             = new Point(x, y);
            var eternityGeneratorPoints = new EternityGeneratorCirclePoints(centerPoint);

            eternityGeneratorPoints.GetNextPoint()
            .ShouldBeEquivalentTo(centerPoint);
        }
Exemplo n.º 3
0
        public void GetNextPoint_ReturnsCorrectPointOnSecondGenerator_WhenTwoGeneratorsAreCreated()
        {
            var firstGenerator  = new EternityGeneratorCirclePoints(0, 0);
            var secondGenerator = new EternityGeneratorCirclePoints(1, 1);

            secondGenerator.GetNextPoint()
            .ShouldBeEquivalentTo(secondGenerator.GetCenterPoint());
        }
Exemplo n.º 4
0
        public void GetNextPoint_ShouldWorksFast_WhenExecutesManyTimes()
        {
            var eternityGeneratorPoints = new EternityGeneratorCirclePoints(0, 0);

            for (var index = 0; index < 1000000; index++)
            {
                eternityGeneratorPoints.GetNextPoint();
            }
        }
Exemplo n.º 5
0
        public void GetCenterPoint_ReturnsCorrectPoint_WhenGetNextPointExecutedManyTimes()
        {
            var centerPoint     = new Point(10, 10);
            var generatorPoints = new EternityGeneratorCirclePoints(centerPoint);

            for (var index = 0; index < 10000; index++)
            {
                generatorPoints.GetNextPoint();
            }

            generatorPoints.GetCenterPoint()
            .ShouldBeEquivalentTo(centerPoint);
        }