예제 #1
0
            public void SetsCatelModelPropertyValue()
            {
                var adapter = new ReflectionObjectAdapter();
                var model   = new PersonTestModel();

                Assert.IsTrue(adapter.SetMemberValue(model, nameof(PersonTestModel.FirstName), "John"));
                Assert.AreEqual("John", model.FirstName);
            }
예제 #2
0
            public void GetsCatelModelPropertyValue()
            {
                var adapter = new ReflectionObjectAdapter();
                var model   = new PersonTestModel
                {
                    FirstName = "John"
                };

                string value = string.Empty;

                Assert.IsTrue(adapter.GetMemberValue(model, nameof(PersonTestModel.FirstName), out value));
                Assert.AreEqual("John", model.FirstName);
            }