Wraps a NumericUpDown control in order to display and capture an integer property of the business object
상속: NumericUpDownMapper
        public void TestSetBusinessObject()
        {
            //---------------Set up test pack-------------------
            INumericUpDown numUpDown = GetControlFactory().CreateNumericUpDownInteger();
            NumericUpDownIntegerMapper mapper = new NumericUpDownIntegerMapper(numUpDown, INT_PROP_NAME, false, GetControlFactory());
            Sample s = new Sample();
            s.SampleInt = 100;
            //---------------Execute Test ----------------------
            mapper.BusinessObject = s;
            //---------------Test Result -----------------------
            Assert.AreEqual(100, numUpDown.Value, "Value is not set.");

            //---------------Tear Down -------------------------
        }
 public void Test_BusinessObjectChanged_UpdatesControl()
 {
     //---------------Set up test pack-------------------
     INumericUpDown numUpDown = GetControlFactory().CreateNumericUpDownInteger();
     NumericUpDownIntegerMapper mapper = new NumericUpDownIntegerMapper(numUpDown, INT_PROP_NAME, false, GetControlFactory());
     Sample s = new Sample();
     s.SampleInt = 100;
     mapper.BusinessObject = s;
     //---------------Execute Test ----------------------
     int newValue = 555;
     s.SampleInt = newValue;
     //---------------Test Result -----------------------
     Assert.AreEqual(newValue, numUpDown.Value);
     //---------------Tear down -------------------------
 }
 public void Test_ValueChangedEvent_UpdatesBusinessObject()
 {
     //---------------Set up test pack-------------------
     INumericUpDown numUpDown = GetControlFactory().CreateNumericUpDownInteger();
     NumericUpDownIntegerMapper mapper = new NumericUpDownIntegerMapper(numUpDown, INT_PROP_NAME, false, GetControlFactory());
     Sample s = new Sample();
     s.SampleInt = 100;
     mapper.BusinessObject = s;
     //---------------Execute Test ----------------------
     int newValue = 555;
     numUpDown.Value = newValue;
     //---------------Test Result -----------------------
     Assert.IsInstanceOf(typeof(NumericUpDownMapperStrategyWin), mapper.MapperStrategy);
     Assert.AreEqual(newValue, s.SampleInt);
     //---------------Tear down -------------------------
 }
        public void TestConstructor()
        {
            //---------------Set up test pack-------------------
            INumericUpDown numUpDown = GetControlFactory().CreateNumericUpDownInteger();
            //---------------Execute Test ----------------------
            NumericUpDownIntegerMapper mapper = new NumericUpDownIntegerMapper(numUpDown, INT_PROP_NAME, false, GetControlFactory());

            //---------------Test Result -----------------------
            Assert.AreSame(numUpDown, mapper.Control);
            Assert.AreSame(INT_PROP_NAME, mapper.PropertyName);
            Assert.AreEqual(0, numUpDown.DecimalPlaces);
            Assert.AreEqual(int.MinValue, numUpDown.Minimum);
            Assert.AreEqual(int.MaxValue, numUpDown.Maximum);

            //---------------Tear Down -------------------------
        }