Esempio n. 1
0
        public void TestChoose()
        {
            maxCounter = 1;
            type = TrainingType.Choose;

            Training training = new Training(dictionary, isSwitched, maxCards, maxCounter, type, learnedBefore);
            CheckTrainingList(training);

            // go trough all cards in training and choose cards
            var currentCard = training.NextCard();
            while (currentCard != null)
            {
                var chooseList = training.Choose();
                CheckChooseList(chooseList, currentCard);
                currentCard = training.NextCard();
            }
        }
Esempio n. 2
0
        public void TestChooseCardsLessThanType()
        {
            maxCounter = 1;
            type = TrainingType.Choose;

            Training training = new Training(dictionary, isSwitched, maxCards, maxCounter, type, learnedBefore);
            CheckTrainingList(training);

            // set word type as currentCard            
            foreach (var card in dictionary)
                card.Type = WordType.Noun;
            var currentCard = training.NextCard();
            currentCard.Type = WordType.Verb;
            for (int i = 0; i < dictionary.Count - 1; i++)
                dictionary[i].Type = currentCard.Type;
            var chooseList = training.Choose(cardsToChoose);
            CheckChooseList(chooseList, currentCard);
        }
Esempio n. 3
0
        public void TestChooseCards0Type()
        {
            maxCounter = 1;
            type = TrainingType.Choose;

            Training training = new Training(dictionary, isSwitched, maxCards, maxCounter, type, learnedBefore);
            CheckTrainingList(training);

            // all other cards have different type as currentCard
            foreach (var card in dictionary)
                card.Type = WordType.Noun;
            var currentCard = training.NextCard();
            currentCard.Type = WordType.Verb;
            var chooseList = training.Choose(cardsToChoose);
            CheckChooseList(chooseList, currentCard);
        }
Esempio n. 4
0
        public void TestChooseCardsMoreThanAvailableType()
        {
            maxCounter = 1;
            type = TrainingType.Choose;

            Training training = new Training(dictionary, isSwitched, maxCards, maxCounter, type, learnedBefore);
            CheckTrainingList(training);

            // set word type as currentCard
            var currentCard = training.NextCard();
            foreach (var card in dictionary)
                card.Type = currentCard.Type;
            var chooseList = training.Choose(cardsToChoose);
            CheckChooseList(chooseList, currentCard);
        }