public void MemoryList_isEmptyAfterItemRecall() { MemoryList <string> l = new MemoryList <string>(); l.StoreValue("V"); string v = l.RecallValue(); Assert.False(l.HasValues()); }
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"); }
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); }
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()); } }