Exemple #1
0
        public void UnitCountStart()
        {
            Board board = Board.GetInitialBoard();

            FeatureToolCollection toolCollection = new FeatureToolCollection();

            toolCollection.Add(new UnitCountPercentage());
            FeatureMeasurementCollection measurements = toolCollection.GetMeasurements(board);

            Assert.AreEqual(7, measurements.Count);
            // terrible
            Assert.AreEqual(4d / 22d, measurements.Where(m => m.Power == Powers.Russia).Single().Value);
            Assert.AreEqual(Math.Round(18d / 22d, 5), Math.Round(measurements.Where(m => m.Power != Powers.Russia).Sum(m => m.Value), 5));
        }
Exemple #2
0
        public void OwnedSupplyCentersStart()
        {
            Board board = Board.GetInitialBoard();

            FeatureToolCollection toolCollection = new FeatureToolCollection();

            toolCollection.Add(new OwnedSupplyCentersPercentage());
            FeatureMeasurementCollection measurements = toolCollection.GetMeasurements(board);

            Assert.AreEqual(8, measurements.Count);
            // terrible
            Assert.AreEqual(1, Math.Round(measurements.Sum(v => v.Value)));
            Assert.AreEqual(18d / 34d, measurements.Where(m => m.Power != Powers.Russia && m.Power != Powers.None).Sum(m => m.Value));
            Assert.AreEqual(13d / 34d, measurements.Where(m => m.Power == Powers.None).Single().Value);
        }
Exemple #3
0
        public void MapEdgesAtStart()
        {
            Board board = Board.GetInitialBoard();

            FeatureToolCollection toolCollection = new FeatureToolCollection();

            toolCollection.Add(new MapEdgesControlled());
            FeatureMeasurementCollection measurements = toolCollection.GetMeasurements(board);

            Assert.AreEqual(1, measurements.Count);
            Assert.AreEqual(3, measurements.Where(m => m.Power == Powers.Russia).Single().Value);
        }