public void SetMethod_Integer_SetsValue() { var types = new TypeMemberInfoCollection(); var source = new MethodBasedViewModel(); var isInvalidSet = types.SetMethodValue(source, "BogusMethod", "123"); Assert.IsFalse(isInvalidSet); }
public void SetMethod_InvalidValue_DoesNotSetValue() { var types = new TypeMemberInfoCollection(); var source = new MethodBasedViewModel(); var isValueSet = types.SetMethodValue(source, "SetMethod", "ABC"); var value = types.GetMethodValue(source, "GetMethod")?? 0; Assert.IsFalse(isValueSet); Assert.IsTrue(value is int); Assert.AreEqual<int>(0, (int)value); }