Ejemplo n.º 1
0
        public void SimpleTest()
        {
            var wordUtil = new WordUtil();
            var words = new string[] { "tap", "taps", "top", "tops" };
            var expectWordCount = words.Length;

            wordUtil.AddWords(words);
            Assert.AreEqual(expectWordCount, wordUtil.Count);
            var ms = new MemoryStream();

            wordUtil.SaveTo(ms);
            Assert.Greater(ms.Length, 0);

            ms.Position = 0;
            wordUtil = WordUtil.LoadFrom(ms);
            Assert.AreEqual(expectWordCount, wordUtil.Count);
        }