Example #1
0
        public string AffiliationProcessorTest(string groups, IEnumerable <Point> points)
        {
            var isHorizontal = false;
            var processor    = new AffiliationProcessor(isHorizontal);
            var line         = new CrossWordLine(TestHelper.ParseGroups(groups).ToArray(), points.ToArray(), isHorizontal, new[] { processor });

            line.TrySolveStep(null);
            line.TrySolveStep(null);
            return(points.RenderToString());
        }
Example #2
0
        public string SolveStep_Test(string lineData, IEnumerable <Point> points)
        {
            var groups = TestHelper.ParseGroups(lineData).ToArray();

            var columnProcessors = new ILineProcessor[]
            {
                new ShiftProcessor(false),
                new FillProcessor(false),
                new AffiliationProcessor(false),
                new CompletionProcessor(),
            };

            var cwLine = new CrossWordLine(groups, points.ToArray(), true, columnProcessors);

            cwLine.TrySolveStep(null);
            return(points.RenderToString());
        }
Example #3
0
        public void CreateCrossWordLine_Test()
        {
            var groups = DataSourceCWLine.GroupsData;
            var points = DataSourceCWLine.PointsData_10;
            var cwLine = new CrossWordLine(groups, points, true, null);

            foreach (var point in points)
            {
                var possible = point.PossibleHorizontalGroups;
                for (int i = 0; i < possible.Count; i++)
                {
                    var expected = groups.ElementAt(i);
                    var actual   = possible.ElementAt(i);
                    Assert.AreEqual(expected, actual);
                }
            }
        }