コード例 #1
0
ファイル: SolveBaseTests.cs プロジェクト: rotemtzaban/ghc17
        public void GetIngInSlice_MultipleTiles_Edges()
        {
            var parser = new Parser();
            var pizza  = parser.ParseData(Resources.example);

            var solver = new PizzaSolverBasic(pizza);

            Assert.AreEqual(0, solver.GetMushroomsInSlice(new PizzaSlice(1, 0, 4, 0)));
            Assert.AreEqual(4, solver.GetTomatoInSlice(new PizzaSlice(1, 0, 4, 0)));

            Assert.AreEqual(2, solver.GetMushroomsInSlice(new PizzaSlice(1, 0, 2, 2)));
            Assert.AreEqual(4, solver.GetTomatoInSlice(new PizzaSlice(1, 0, 2, 2)));
        }
コード例 #2
0
ファイル: SolveBaseTests.cs プロジェクト: rotemtzaban/ghc17
        public void GetIngInSlice_SingleTile()
        {
            var parser = new Parser();
            var pizza  = parser.ParseData(Resources.example);

            var solver = new PizzaSolverBasic(pizza);

            Assert.AreEqual(0, solver.GetMushroomsInSlice(new PizzaSlice(0, 0, 0, 0)));
            Assert.AreEqual(1, solver.GetTomatoInSlice(new PizzaSlice(0, 0, 0, 0)));

            Assert.AreEqual(1, solver.GetMushroomsInSlice(new PizzaSlice(1, 1, 1, 1)));
            Assert.AreEqual(0, solver.GetTomatoInSlice(new PizzaSlice(1, 1, 1, 1)));
        }