public void When_all_correct_values_for_all_cells_are_added_should_return_true_if_IsWordAnswerCorrect_is_called()
        {
            var wordViewModel = new WordViewModel();
            wordViewModel.Cells = new ObservableCollection<CellEmptyViewModel>();
            const string word = "testword";
            int row = 0;
            foreach (object character in word)
            {
                var cell = new CellViewModel(0, row, character.ToString(), wordViewModel, string.Empty);
                row += 1;
                wordViewModel.Cells.Add(cell);
            }

            foreach (CellEmptyViewModel cell in wordViewModel.Cells)
            {
                var keyReceivedMessage = new KeyReceivedMessage {KeyChar = cell.Value};
                var cellValueChangedMesage = new CellValueChangedMessage()
                        {
                            Character = keyReceivedMessage.KeyChar,
                            Col = cell.Col,
                            Row = cell.Row
                        };

                Messenger.Default.Send(cellValueChangedMesage);
            }

            Assert.IsTrue(wordViewModel.IsWordAnswerCorrect);
        }
        public List<WordViewModel> GetWordsWordviewmodels()
        {
            var words = _words ?? new Dictionary<string, string>
                                 {
                                     {"Bamidele", "Adetoro's first name. Rashedat omo Abdulrahaman Adedayo Baruwa and Rasheedat Patience Binta OluwaFunmilayo Baruwa. Sister to Abdulrasheed Ademola Dabira Adedayo Baruwa "},
                                     {"station", "place where i fit get train"},
                                     {"india", "Origin of my favourite curry, spicy hot tropical country. With loads and loads of people. Probably the second most populated country Origin of my favourite curry, spicy hot tropical country. With loads and loads of people. Probably the second most populated country"},
                                     {"Adams", "Captain Arsenal"},
                                     {"fards", "show off"},
                                     {"novemb", "like november"},
                                     {"belt", "Tied around my waist"},
                                     {"train", "Mode of transportation"},
                                     {"adeola", "My sister"},
                                     {"amoeba", "Single cell organism"},
                                     {"moscow", "Cold city behind iron curtain"}
                                 };
            //var words = new List<string>();
            //words.Add("Bamidele");
            //words.Add("station");
            //words.Add("india");
            //words.Add("Adams");
            //words.Add("fards");
            //words.Add("novemb");
            //words.Add("belt");
            //words.Add("train");
            //words.Add("adeola");
            //words.Add("amoeba");
            //words.Add("moscow");

            var board = CoreHorizontal.GetBoard(12, 12);
            var result = (CoreVertical.AddWordsAttempts(words.Keys.ToArray(), board));

            var wordsInserted = result.Item1.Where(x => x.inserted);
            var wordviewmodels = new List<WordViewModel>();
            foreach (var word in wordsInserted)
            {
                var position = (word.row * 12) + word.col;

                CoreHorizontal.resultCell word1 = word;
                var wordViewModel = new WordViewModel()
                                        {
                                            Cells = new ObservableCollection<CellEmptyViewModel>(),
                                            Direction = GetDirection(word.orientation),
                                            Word = word.word,
                                            WordHint = words.First(x => x.Key == word1.word).Value,
                                            WordLength = "(" + word.word.Length.ToString() + ")",
                                            Index = position
                                        };

                var row = word.row;
                var col = word.col;
                foreach (var character in word.word)
                {
                    var cell = new CellViewModel(col, row, character.ToString(), wordViewModel, string.Empty);
                    if (word.orientation == CoreHorizontal.Orientation.horizontal)
                        col += 1;
                    else
                        row += 1;

                    wordViewModel.Cells.Add(cell);
                }
                wordviewmodels.Add((wordViewModel));
            }
            return wordviewmodels;
        }
        public void AddWordsToBoard()
        {
            foreach (WordViewModel wordViewModel in Words)
            {
                bool firstCellVisited = false;
                foreach (CellEmptyViewModel cell in wordViewModel.Cells)
                {
                    string startPositionForWordOnBoard = string.Empty;

                    int cellPositionOnBoard = (cell.Row*12) + cell.Col;
                    if (!firstCellVisited) startPositionForWordOnBoard = wordViewModel.Index.ToString();
                    firstCellVisited = true;
         
                    Cells[cellPositionOnBoard] = new CellViewModel(cell.Col, cell.Row, cell.Value, wordViewModel, startPositionForWordOnBoard);
                }
            }
        }
        public List<WordViewModel> GetWordsWordviewmodels(Dictionary<string,string> words)
        {
            ////var words = new List<string>();
            //words.Add("Bamidele");
            //words.Add("station");
            //words.Add("india");
            //words.Add("Adams");
            //words.Add("fards");
            //words.Add("novemb");
            //words.Add("belt");
            //words.Add("train");
            //words.Add("adeola");
            //words.Add("amoeba");
            //words.Add("moscow");
            var board = CoreHorizontal.GetBoard(12, 12);
            //var wordKeys = words. .Select(x => x.Key).ToArray();
            var result = (CoreVertical.AddWordsAttempts(words.Keys.ToArray(), board));
            PrintBoard(board);
            var wordsInserted = result.Item1.Where(x => x.inserted);
            var wordviewmodels = new List<WordViewModel>();
            foreach (var word in wordsInserted)
            {
                Debug.WriteLine(word.word);
                var position = (word.row * 12) + word.col;
                CoreHorizontal.resultCell word1 = word;
                var wordViewModel = new WordViewModel()
                {
                    Cells = new ObservableCollection<CellEmptyViewModel>(),
                    Direction = GetDirection(word.orientation),
                    Word = word.word,
                    WordHint = words.First(x =>x.Key == word1.word).Value,
                    WordLength = "(" + word.word.Length.ToString() + ")",
                    Index = position
                };

                var row = word.row;
                var col = word.col;
                foreach (var character in word.word)
                {
                    var cell = new CellViewModel(col, row, character.ToString(), wordViewModel, string.Empty);
                    if (word.orientation == CoreHorizontal.Orientation.horizontal)
                        col += 1;
                    else
                        row += 1;

                    wordViewModel.Cells.Add(cell);
                }
                wordviewmodels.Add((wordViewModel));
            }
            return wordviewmodels;
        }