public void ResetButtonClearsCountersAndListBox() { PropertyControlPanel control = new PropertyControlPanel(); PropertyInfo info = typeof(TestClass).GetProperty("PublicStaticProperty"); control.Initialize(info); control.buttonGet_Click(null, null); control.buttonGet_Click(null, null); control.buttonGet_Click(null, null); control.buttonGet_Click(null, null); control.buttonReset_Click(null, null); Assert.AreEqual(0, control.average_count); Assert.AreEqual(0, control.comboBoxMessageBar.Items.Count); Assert.IsFalse(control.comboBoxMessageBar.Enabled); }
public void InvokeGetMultipleTimes() { TestClass.get_counter = 0; PropertyControlPanel control = new PropertyControlPanel(); PropertyInfo info = typeof(TestClass).GetProperty("PublicStaticProperty"); control.Initialize(info); control.InvokeCount = 8; control.buttonGet_Click(null, null); Assert.AreEqual(9, TestClass.get_counter); }