public void should_set_property_values() { var @object = new GetAndSetPropertyAndFieldValues(); typeof(GetAndSetPropertyAndFieldValues).GetProperty("Property") .BuildSetter(typeof(string))(@object, "property"); @object.Property.ShouldEqual("property"); }
public void should_set_field_values() { var @object = new GetAndSetPropertyAndFieldValues(); typeof(GetAndSetPropertyAndFieldValues).GetField("_field") .BuildSetter(typeof(string))(@object, "field"); @object._field.ShouldEqual("field"); }
public void should_set_optional_property_values() { var @object = new GetAndSetPropertyAndFieldValues(); typeof(GetAndSetPropertyAndFieldValues).GetProperty("OptionalProperty") .BuildSetter(typeof(string))(@object, "property"); @object.OptionalProperty.HasValue.ShouldBeTrue(); @object.OptionalProperty.Value.ShouldEqual("property"); }
public void should_get_optional_property_values() { var @object = new GetAndSetPropertyAndFieldValues { OptionalProperty = "property" }; typeof(GetAndSetPropertyAndFieldValues).GetProperty("OptionalProperty") .BuildGetter(typeof(string))(@object).ShouldEqual("property"); }
public void should_set_optional_field_values() { var @object = new GetAndSetPropertyAndFieldValues(); typeof(GetAndSetPropertyAndFieldValues).GetField("_optionalField") .BuildSetter(typeof(string))(@object, "field"); @object._optionalField.HasValue.ShouldBeTrue(); @object._optionalField.Value.ShouldEqual("field"); }
public void should_get_optional_field_values() { var @object = new GetAndSetPropertyAndFieldValues { _optionalField = "field" }; typeof(GetAndSetPropertyAndFieldValues).GetField("_optionalField") .BuildGetter(typeof(string))(@object).ShouldEqual("field"); }
public void should_set_property_values() { var @object = new GetAndSetPropertyAndFieldValues(); typeof(GetAndSetPropertyAndFieldValues).GetProperty("Property") .BuildSetter(typeof(string))(@object, "property"); @object.Property.ShouldEqual("property"); }
public void should_set_optional_property_values() { var @object = new GetAndSetPropertyAndFieldValues(); typeof(GetAndSetPropertyAndFieldValues).GetProperty("OptionalProperty") .BuildSetter(typeof(string))(@object, "property"); @object.OptionalProperty.HasValue.ShouldBeTrue(); @object.OptionalProperty.Value.ShouldEqual("property"); }
public void should_set_optional_field_values() { var @object = new GetAndSetPropertyAndFieldValues(); typeof(GetAndSetPropertyAndFieldValues).GetField("_optionalField") .BuildSetter(typeof(string))(@object, "field"); @object._optionalField.HasValue.ShouldBeTrue(); @object._optionalField.Value.ShouldEqual("field"); }
public void should_set_field_values() { var @object = new GetAndSetPropertyAndFieldValues(); typeof(GetAndSetPropertyAndFieldValues).GetField("_field") .BuildSetter(typeof(string))(@object, "field"); @object._field.ShouldEqual("field"); }
public void should_get_property_values() { var @object = new GetAndSetPropertyAndFieldValues { Property = "property" }; typeof(GetAndSetPropertyAndFieldValues).GetProperty("Property") .BuildGetter(typeof(string))(@object).ShouldEqual("property"); }
public void should_get_optional_field_values() { var @object = new GetAndSetPropertyAndFieldValues { _optionalField = "field" }; typeof(GetAndSetPropertyAndFieldValues).GetField("_optionalField") .BuildGetter(typeof(string))(@object).ShouldEqual("field"); }