Beispiel #1
0
        public void ClearWordsTest()
        {
            TestInfrastructure.DebugLineStart(TestContext);
            if (TestInfrastructure.IsActive(TestContext))
            {
                using (IDictionary writeLM = TestInfrastructure.GetLMConnection(TestContext, TestInfrastructure.GetAdminUser))
                {
                    ICard  card  = writeLM.Cards.AddNew();
                    IWords words = card.Question;

                    for (int i = 0; i < TestInfrastructure.Random.Next(10, 50); i++)
                    {
                        IWord word = words.CreateWord("Word " + i.ToString(), WordType.Word, true);
                        words.AddWord(word);
                    }

                    words.ClearWords();
                    Assert.IsTrue(words.Words.Count == 0, "IWords.ClearWords does not delete all words.");
                }
            }
            TestInfrastructure.DebugLineEnd(TestContext);
        }