public void GetValueGenericStruct() { var source = new StructLevel { Name = "meh" }; var getter = (Getter <StructLevel, string>)Getter.GetOrCreate(typeof(StructLevel).GetProperty("Name")); Assert.AreEqual("meh", getter.GetValue(source)); }
public void GetValueGenericStruct() { var source = new StructLevel { Name = "meh" }; var getter = (Getter <StructLevel, string>)Getter.GetOrCreate(typeof(StructLevel).GetProperty(nameof(StructLevel.Name), BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)); Assert.AreEqual("meh", getter.GetValue(source)); }