Exemple #1
0
        public void AddItem_Test()
        {
            GridFieldModel grid = new GridFieldModel(10, 10, 0.5f);
            //ProductModel i1 = new ProductModel("Chair 1", "Atlas", "Chair", "Chair", "Deskchair", 2, 2, 2, "een stoel", 1);
            ProductModel i1 = new ProductModel(2, 2, 2);

            int x = 5; // x and y have to be the tilenumber that the user wants to add an item to.
            int y = 5; //

            grid.AddItem(5, 2, i1);

            bool found = false;

            for (int i = 0; i < grid.Rows.GetLength(0); i++)
            {
                for (int j = 0; j < grid.Rows.GetLength(1); j++)
                {
                    if (grid[i, j].Product == i1)
                    {
                        found = true;
                    }
                }
            }
            Assert.IsTrue(found);
        }