Esempio n. 1
0
        public void ChangeSymbolInPentagonLabyrinthTest()
        {
            labyrinth = new PentagonLabyrinth();
            labyrinth.FillMatrix(randomCharProvider);

            labyrinth.ChangeSymbol(coordinates, ChangedSymbol);
            bool isChanged = ChangedSymbol == labyrinth.Matrix[DefaultRowCoordinate, DefaultColCoordinate];

            Assert.IsTrue(isChanged);
        }
Esempio n. 2
0
        /// <summary>
        /// Creates labyrinth of type asked by the user
        /// </summary>
        /// <param name="userChoiceOfLabyrinth">Type of labyrinth asked by user</param>
        /// <returns>Returns a labyrinth of type as given in parameter with name "userChoiceOfLabyrinth"</returns>
        public ILabyrinth Create(string userChoiceOfLabyrinth)
        {
            // Ninject used to get contracted class
            var kernel = new StandardKernel();

            kernel.Load(Assembly.GetExecutingAssembly());
            var randomGenerator = kernel.Get <IRandomCharProvider>();

            TypeLabyrinth typeOfLabyrinth = this.GetLabyrinthType(userChoiceOfLabyrinth);
            ILabyrinth    labyrinth       = this.CreateRequiredLabyrinth(typeOfLabyrinth);

            labyrinth.FillMatrix(randomGenerator);

            return(labyrinth);
        }