public void DistrubutionIsNotEqual()
        {
            IPointGenerator pointGenerator = new XSquaredPointListGenerator(10);
            int             count          = 10000;
            int             width          = 200;
            int             height         = 200;

            pointGenerator.CreateList(width, height, count);
            List <Point> output = pointGenerator.GetList();
            double       countXLargerThanHundred   = output.Count(c => c.X > 100);
            double       countYLargerThanHundred   = output.Count(c => c.Y > 100);
            double       percentXLargerThanHundret = countXLargerThanHundred / count;
            double       percentYLargerThanHundret = countYLargerThanHundred / count;

            Assert.AreEqual(0.75, percentXLargerThanHundret, 0.01);
            Assert.AreEqual(0.75, percentYLargerThanHundret, 0.01);
        }
Пример #2
0
 private void GenerateSquaredPoints()
 {
     IPointGenerator pointGenerator = new XSquaredPointListGenerator(10);
     pointGenerator.CreateList(width, height, count);
     points = pointGenerator.GetList();
 }