A dynamic mustache model.
Наследование: System.Dynamic.DynamicObject
Пример #1
0
        public void Should_add_properties_dynamically()
        {
            dynamic model = new MustacheModel();
            model.Value = 123;

            Assert.That(model.Value, Is.EqualTo(123));
        }
Пример #2
0
        public void Should_return_dynamic_member_names()
        {
            dynamic model = new MustacheModel();
            model.Value = 123;

            IEnumerable<string> members = model.GetDynamicMemberNames();
            CollectionAssert.AreEquivalent(members, new[] { "Value" });
        }
Пример #3
0
 public void Should_add_properties_from_object_passed_to_constructor()
 {
     dynamic model = new MustacheModel(new { Value = 123 });
     Assert.That(model.Value, Is.EqualTo(123));
 }