public void Should_Match_Static_Member_Value() { dynamic person = new DynamicPerson(); person.Name = "My New Name"; Assert.AreEqual("My New Name", person.Name); }
public void Should_Set_Value_Static_Member() { dynamic obj = new DynamicPerson(); obj.Name = "Joao Bosco"; Assert.AreEqual("Joao Bosco", obj.Name); }
public void Should_Return_List_With_Members_If_There_Is_Dynamic_And_Static_Members() { //DynamicPerson object has a static Name Property dynamic propertyBag = new DynamicPerson(); propertyBag.Age = 27; IEnumerable<string> memberList = propertyBag.GetAllMemberNames(); //Wrap IEnumerable in a list to simplify Assert List<string> propertyList = new List<string>(memberList); Assert.IsNotNull(propertyList); Assert.AreEqual(2, propertyList.Count); }
public void Should_Return_List_With_Member_Name_If_There_Is_Static_Member() { //DynamicPerson object has a static Name Property dynamic propertyBag = new DynamicPerson(); IEnumerable<string> memberList = propertyBag.GetStaticMemberNames(); //Wrap IEnumerable in a list to simplify Assert List<string> propertyList = new List<string>(memberList); Assert.IsNotNull(propertyList); //Check if property list contain "Name" at the first position Assert.AreEqual("Name", propertyList[0]); Assert.AreEqual(1, propertyList.Count); }
public void Should_Find_Static_Member() { dynamic person = new DynamicPerson(); Assert.IsNotNull(person.Name); }