public void ScrollProperties_Visible_SetNullContainer_ThrowsNullReferenceException(bool value) { var properties = new SubScrollProperties(null); Assert.Throws <NullReferenceException>(() => properties.Visible = value); Assert.False(properties.Visible); }
public void ScrollProperties_Value_SetNullContainer_ThrowsNullReferenceException() { var properties = new SubScrollProperties(null); Assert.Throws <NullReferenceException>(() => properties.Value = 10); Assert.Equal(10, properties.Value); }
public void ScrollProperties_Enabled_SetNullContainer_ThrowsNullReferenceException() { var properties = new SubScrollProperties(null); Assert.Throws <NullReferenceException>(() => properties.Enabled = false); Assert.True(properties.Enabled); }
public void ScrollProperties_Minimum_SetNullContainer_ThrowsNullReferenceException() { var properties = new SubScrollProperties(null); Assert.Throws <NullReferenceException>(() => properties.Minimum = 10); Assert.Equal(0, properties.Minimum); }
public void ScrollProperties_SmallChange_SetNegative_ThrowsArgumentOutOfRangeException() { var control = new ScrollableControl(); var properties = new SubScrollProperties(control); Assert.Throws <ArgumentOutOfRangeException>("SmallChange", () => properties.SmallChange = -1); Assert.Equal(1, properties.SmallChange); }
public void ScrollProperties_Minimum_SetNegative_ThrowsArgumentOutOfRangeException() { var control = new ScrollableControl(); var properties = new SubScrollProperties(control); Assert.Throws <ArgumentOutOfRangeException>("Minimum", () => properties.Minimum = -1); Assert.Equal(0, properties.Minimum); }
public void ScrollProperties_Value_SetOutOfRange_ThrowsArgumentOutOfRangeException(int value) { var control = new ScrollableControl(); var properties = new SubScrollProperties(control); Assert.Throws <ArgumentOutOfRangeException>("Value", () => properties.Value = value); Assert.Equal(0, properties.Value); }
public void ScrollProperties_LargeChange_SetNegative_ThrowsArgumentOutOfRangeException() { var container = new ScrollableControl(); var properties = new SubScrollProperties(container); Assert.Throws <ArgumentOutOfRangeException>("value", () => properties.LargeChange = -1); Assert.Equal(10, properties.LargeChange); }
public void ScrollProperties_SmallChange_Set_GetReturnsExpected(int value, int expectedValue) { var control = new ScrollableControl(); var properties = new SubScrollProperties(control) { SmallChange = value }; Assert.Equal(expectedValue, properties.SmallChange); }
public void ScrollProperties_Enabled_Set_GetReturnsExpected(bool value) { var control = new ScrollableControl(); var properties = new SubScrollProperties(control) { Enabled = value }; Assert.Equal(value, properties.Enabled); }
public void ScrollProperties_Visible_Set_GetReturnsExpected(bool value) { var control = new ScrollableControl(); var properties = new SubScrollProperties(control) { Visible = value }; Assert.Equal(value, properties.Visible); }
public void ScrollProperties_LargeChange_Set_GetReturnsExpected(int value) { var control = new ScrollableControl(); var properties = new SubScrollProperties(control) { LargeChange = value }; Assert.Equal(value, properties.LargeChange); }
public void ScrollProperties_SmallChange_SetNullContainer_ReturnsExpected(int value, int expectedValue) { var properties = new SubScrollProperties(null) { SmallChange = value }; Assert.Equal(expectedValue, properties.SmallChange); // Set same. properties.SmallChange = value; Assert.Equal(expectedValue, properties.SmallChange); }
public void ScrollProperties_LargeChange_SetNullContainer_GetReturnsExpected(int value) { var properties = new SubScrollProperties(null) { LargeChange = value }; Assert.Equal(value, properties.LargeChange); // Set same. properties.LargeChange = value; Assert.Equal(value, properties.LargeChange); }
public void ScrollProperties_Ctor_Control(ScrollableControl container) { var properties = new SubScrollProperties(container); Assert.Equal(container, properties.ParentControlEntry); Assert.True(properties.Enabled); Assert.Equal(10, properties.LargeChange); Assert.Equal(1, properties.SmallChange); Assert.Equal(100, properties.Maximum); Assert.Equal(0, properties.Minimum); Assert.Equal(0, properties.Value); Assert.False(properties.Visible); }
public void ScrollProperties_Visible_SetAutoScrollContainer_Nop(bool value) { var control = new ScrollableControl() { AutoScroll = true }; var properties = new SubScrollProperties(control) { Visible = value }; Assert.False(properties.Visible); }
public void ScrollProperties_Enabled_SetAutoScrollContainer_Nop(bool value) { var control = new ScrollableControl() { AutoScroll = true }; var properties = new SubScrollProperties(control) { Enabled = value }; Assert.True(properties.Enabled); }
public void ScrollProperties_LargeChange_Set_GetReturnsExpected(int value) { using var container = new ScrollableControl(); var properties = new SubScrollProperties(container) { LargeChange = value }; Assert.Equal(value, properties.LargeChange); // Set same. properties.LargeChange = value; Assert.Equal(value, properties.LargeChange); }
public void ScrollProperties_Value_Set_GetReturnsExpected(int value) { var control = new ScrollableControl(); var properties = new SubScrollProperties(control) { Value = value }; Assert.Equal(100, properties.Maximum); Assert.Equal(0, properties.Minimum); Assert.Equal(value, properties.Value); Assert.Equal(10, properties.LargeChange); Assert.Equal(1, properties.SmallChange); }
public void ScrollProperties_Maximum_SetNegative_SetsValueAndMinimum() { var control = new ScrollableControl(); var properties = new SubScrollProperties(control) { Maximum = -1 }; Assert.Equal(-1, properties.Maximum); Assert.Equal(-1, properties.Minimum); Assert.Equal(-1, properties.Value); Assert.Equal(1, properties.LargeChange); Assert.Equal(1, properties.SmallChange); }
public void ScrollProperties_Maximum_SetLessThanValueAndMinimum_SetsValueAndMinimum() { var container = new ScrollableControl(); var properties = new SubScrollProperties(container) { Value = 10, Minimum = 8, Maximum = 5 }; Assert.Equal(5, properties.Maximum); Assert.Equal(5, properties.Minimum); Assert.Equal(5, properties.Value); Assert.Equal(1, properties.LargeChange); Assert.Equal(1, properties.SmallChange); }
public void ScrollProperties_Minimum_SetGreaterThanValueAndMaximum_SetsValueAndMinimum() { var control = new ScrollableControl(); var properties = new SubScrollProperties(control) { Value = 10, Maximum = 8, Minimum = 12 }; Assert.Equal(12, properties.Maximum); Assert.Equal(12, properties.Minimum); Assert.Equal(12, properties.Value); Assert.Equal(1, properties.LargeChange); Assert.Equal(1, properties.SmallChange); }
public void ScrollProperties_Value_SetAutoScrollContainer_GetReturnsExpected(int value) { using var container = new ScrollableControl { AutoScroll = true }; var properties = new SubScrollProperties(container) { Value = value }; Assert.Equal(100, properties.Maximum); Assert.Equal(0, properties.Minimum); Assert.Equal(value, properties.Value); Assert.Equal(10, properties.LargeChange); Assert.Equal(1, properties.SmallChange); }
public void ScrollProperties_SmallChange_SetAutoScrollContainer_GetReturnsExpected(int value, int expectedValue) { var container = new ScrollableControl { AutoScroll = true }; var properties = new SubScrollProperties(container) { SmallChange = value }; Assert.Equal(expectedValue, properties.SmallChange); // Set same. properties.SmallChange = value; Assert.Equal(expectedValue, properties.SmallChange); }
public void ScrollProperties_Enabled_SetNullContainer_GetReturnsExpected(bool value) { var properties = new SubScrollProperties(null) { Enabled = value }; Assert.Equal(value, properties.Enabled); // Set same. properties.Enabled = value; Assert.Equal(value, properties.Enabled); // Set different. properties.Enabled = !value; Assert.Equal(!value, properties.Enabled); }
public void ScrollProperties_Minimum_SetAutoScrollContainer_Nop(int value) { var control = new ScrollableControl { AutoScroll = true }; var properties = new SubScrollProperties(control) { Minimum = value }; Assert.Equal(100, properties.Maximum); Assert.Equal(0, properties.Minimum); Assert.Equal(0, properties.Value); Assert.Equal(10, properties.LargeChange); Assert.Equal(1, properties.SmallChange); }
public void ScrollProperties_Visible_Set_GetReturnsExpected(bool value) { var container = new ScrollableControl(); var properties = new SubScrollProperties(container) { Visible = value }; Assert.Equal(value, properties.Visible); // Set same. properties.Visible = value; Assert.Equal(value, properties.Visible); // Set different. properties.Visible = !value; Assert.Equal(!value, properties.Visible); }
public void ScrollProperties_Enabled_Set_GetReturnsExpected(bool value) { using var container = new ScrollableControl(); var properties = new SubScrollProperties(container) { Enabled = value }; Assert.Equal(value, properties.Enabled); // Set same. properties.Enabled = value; Assert.Equal(value, properties.Enabled); // Set different. properties.Enabled = !value; Assert.Equal(!value, properties.Enabled); }
public void ScrollProperties_Visible_SetAutoScrollContainer_Nop(bool value) { var container = new ScrollableControl() { AutoScroll = true }; var properties = new SubScrollProperties(container) { Visible = value }; Assert.False(properties.Visible); // Set same. properties.Visible = value; Assert.False(properties.Visible); // Set different. properties.Visible = !value; Assert.False(properties.Visible); }
public void ScrollProperties_Enabled_SetAutoScrollContainer_Nop(bool value) { var container = new ScrollableControl() { AutoScroll = true }; var properties = new SubScrollProperties(container) { Enabled = value }; Assert.True(properties.Enabled); // Set same. properties.Enabled = value; Assert.True(properties.Enabled); // Set different. properties.Enabled = !value; Assert.True(properties.Enabled); }