Exemplo n.º 1
0
        public void MemoryList_isEmptyAfterItemRecall()
        {
            MemoryList <string> l = new MemoryList <string>();

            l.StoreValue("V");
            string v = l.RecallValue();

            Assert.False(l.HasValues());
        }
Exemplo n.º 2
0
        public void MemoryList_isQueue()
        {
            MemoryList <string> l = new MemoryList <string>("MyListName", false, true, MemoryList <string> .MemoryListRetrieveSequence.Queue);

            l.StoreValue("Dog");
            l.StoreValue("Cat");
            string v = l.RecallValue();

            Assert.That(v == "Dog");
        }
Exemplo n.º 3
0
        public void MemoryList_has1ItemAfterStoreRecallStoreCaseInsensitve()
        {
            // this test uses the default settings for the class: unique = false,ignoreCase = true
            MemoryList <string> l = new MemoryList <string>();

            l.StoreValue("Giraffe");
            l.RecallValue();
            l.StoreValue("giraffe");
            Assert.That(l.UnconsumedCount() == 1);
        }
Exemplo n.º 4
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            MemoryList <string> MasterList = new MemoryList <string>(
                "MyList", this.chkUnique.Checked, this.chkIgnoreCase.Checked,
                (MemoryList <string> .MemoryListRetrieveSequence)Enum.Parse(
                    typeof(MemoryList <> .MemoryListRetrieveSequence),
                    (string)this.cbxRetrievalMethod.Items[this.cbxRetrievalMethod.SelectedIndex]));

            this.lbxFiltered.Items.Clear();
            foreach (string item in this.lbxSource.Items)
            {
                MasterList.StoreValue(item);
            }
            while (MasterList.HasValues())
            {
                this.lbxFiltered.Items.Add(MasterList.RecallValue());
            }
        }