public void Does_only_return_valid_types() { var dateTime = DateTime.Now; var dateTimeOffset = DateTimeOffset.Now; var item = new TestItem3 { Array = new string[] { "1", "2", "3" }, Bool = true, Byte = 0xFF, Char = 'c', ComplexType = new TestItem2(), DateTime = dateTime, DateTimeOffset = dateTimeOffset, Decimal = 6.66M, Double = 3.33, Enum = TestEnum.High, Float = 2.22f, Guid = Guid.NewGuid(), Int = 6, Long = 7, SByte = 8, Short = 9, SimpleType = "myValue", TimeSpan = TimeSpan.FromSeconds(6.66), UInt = 10, ULong = 11, UShort = 12 }; var result = item.GetProperties(); Assert.Equal(21, result.Count); }
public void Set_Public_Property_Value_IgnoreCase() { var t = new TestItem3("Duy"); t.SetPropertyValue("Description", "Duy"); Assert.AreEqual(t.Description, "Duy"); }
public void Set_Protected_Property_Value() { var t = new TestItem3("Duy"); t.SetPropertyValue("ProtectedObj", "Duy"); Assert.AreEqual(t.PropertyValue("ProtectedObj"), "Duy"); }