Ejemplo n.º 1
0
        public void IntMethod()
        {
            ReadWriteInts target = new ReadWriteInts();

            Assert.That(ValueSetter.CanSetValue(target, "IntMethod"), Is.True);
            ValueSetter.SetValue(target, "IntMethod", 123);
            Assert.That(target.IntMethod(), Is.EqualTo(123));
        }
Ejemplo n.º 2
0
        public void IntFieldWithWrongCase()
        {
            ReadWriteInts target = new ReadWriteInts();

            Assert.That(ValueSetter.CanSetValue(target, "iNTfIELD"), Is.True);
            ValueSetter.SetValue(target, "iNTfIELD", 123);
            Assert.That(target.IntField, Is.EqualTo(123));
        }
Ejemplo n.º 3
0
        public void SettingFormatedValueOnInt32FieldUsesInt32Parser()
        {
            ReadWriteInts target = new ReadWriteInts();

            target.IntField = int.MinValue;
            ValueSetter.SetFormattedValue(target, "IntField", "123rd");
            Assert.That(target.IntField, Is.EqualTo(123));
        }
Ejemplo n.º 4
0
        public void SettingFormattedValueOfNullOnIntFieldSetsItTo0()
        {
            ReadWriteInts target = new ReadWriteInts();

            target.IntField = 123;
            ValueSetter.SetFormattedValue(target, "IntField", null);
            Assert.That(target.IntField, Is.EqualTo(0));
        }
Ejemplo n.º 5
0
        public void IntField()
        {
            ReadWriteInts target = new ReadWriteInts();

            Assert.That(ValueSetter.GetValueType(target, "IntField"), Is.SameAs(typeof(int)));
            Assert.That(ValueSetter.CanSetValue(target, "IntField"), Is.True);
            ValueSetter.SetValue(target, "IntField", 123);
            Assert.That(target.IntField, Is.EqualTo(123));
        }