protected override void SetUp() { IntThing test = new IntThing(50); BindingSource s = new BindingSource(); s.DataSource = test; navigator = new BindingNavigator(s); flag = false; base.SetUp(); }
public void AddWorksAsExpectedBeforeReachingCapacity() { DatabaseCache <RedditThing> cache = new DatabaseCache <RedditThing>(10); for (int i = 0; i < 10; ++i) { var item = new IntThing { Id = i.ToString(), Index = i }; Assert.IsFalse(cache.Contains(item)); cache.Add(item); Assert.IsTrue(cache.Contains(item)); } }
public void AddWorksAsExpectedAfterReachingCapacity() { DatabaseCache <RedditThing> cache = new DatabaseCache <RedditThing>(5); for (int i = 0; i < 10; ++i) { var item = new IntThing { Id = i.ToString(), Index = i }; Assert.IsFalse(cache.Contains(item)); cache.Add(item); Assert.IsTrue(cache.Contains(item)); } var newItem = new IntThing { Id = "777", Index = int.MaxValue }; Assert.IsFalse(cache.Contains(newItem)); }
public void Constructor() { BindingNavigator navigator = new BindingNavigator(true); Assert.AreEqual(11, navigator.Items.Count, "count"); CheckStandardItems(navigator); navigator = new BindingNavigator(false); Assert.IsTrue(navigator.Items.Count == 0, "#01"); IntThing test = new IntThing(50); BindingSource s = new BindingSource(); s.DataSource = test; navigator = new BindingNavigator((BindingSource)null); Assert.AreEqual(11, navigator.Items.Count, "#02"); Assert.AreEqual(50, ((ToolStripTextBox)navigator.PositionItem).TextBox.Width, "#03"); }