Exemple #1
0
        public void FracsWhenRemovingWords()
        {
            WordTargetLayout layout = new WordTargetLayout(new List <string> {
                "VARIABLE", "VALUE", "VAGUE", "UNCLEAR", "STATE"
            });

            layout.AssignWord("VALUE", 3);
            layout.AssignWord("UNCLEAR", 3);
            Assert.AreEqual(2, layout.GetFracsInCircle(3).Count);
            layout.RemoveWord("UNCLEAR", 3);
            Assert.AreEqual(1, layout.GetFracsInCircle(3).Count);
            layout.RemoveWord("VALUE", 3);
            Assert.AreEqual(0, layout.GetFracsInCircle(3).Count);
        }
Exemple #2
0
        public void RemoveWord()
        {
            WordTargetLayout layout = new WordTargetLayout(new List <string> {
                "VARIABLE", "VALUE", "UNCLEAR", "STATE"
            });

            layout.AssignWord("VALUE", 3);
            layout.AssignWord("UNCLEAR", 4);
            Assert.ThrowsException <System.Exception>(() => layout.RemoveWord("NUCLEAR", 2));
            Assert.ThrowsException <System.Exception>(() => layout.RemoveWord("UNCLEAR", 3));
            Assert.ThrowsException <System.Exception>(() => layout.RemoveWord("VARIABLE", 5));
            Assert.ThrowsException <System.Exception>(() => layout.RemoveWord("STATE", 1));
            layout.RemoveWord("VALUE", 3);
            Assert.AreEqual(0, layout.GetWordsInCircle(3).Count);
            Assert.AreEqual(1, layout.GetWordsInCircle(4).Count);
            Assert.AreEqual("UNCLEAR", layout.GetWordsInCircle(4)[0]);
        }