public void Do_not_throw_if_target_object_properties_do_not_exist(string platformName) { var platform = GetPlatform(platformName); Type typeToMap = typeof(StringValueTypeProperties); InitializeMapperService(); using var module = typeToMap.Extend <IModelListView>(); using var application = DefaultModelMapperModule(platform, module).Application; var modelListView = application.Model.Views.OfType <IModelListView>().First(); var modelModelMap = (IModelModelMap)modelListView.MapNode(typeToMap); modelModelMap.Index = 100; var stringValueTypeProperties = new StringValueTypeProperties(); modelModelMap.BindTo(stringValueTypeProperties); }
internal void Do_not_throw_if_target_object_properties_do_not_exist(Platform platform) { Type typeToMap = typeof(StringValueTypeProperties); InitializeMapperService($"{nameof(Do_not_throw_if_target_object_properties_do_not_exist)}{typeToMap.Name}{platform}"); var module = typeToMap.Extend <IModelListView>(); var application = DefaultModelMapperModule(platform, module).Application; var modelListView = application.Model.Views.OfType <IModelListView>().First(); var modelModelMap = (IModelModelMap)modelListView.MapNode(typeToMap); modelModelMap.Index = 100; var stringValueTypeProperties = new StringValueTypeProperties(); modelModelMap.BindTo(stringValueTypeProperties); }
public void Bind_all_public_rw_string_properties(string platformName) { var platform = GetPlatform(platformName); Type typeToMap = typeof(StringValueTypeProperties); InitializeMapperService(); using var module = typeToMap.Extend <IModelListView>(); using var application = DefaultModelMapperModule(platform, module).Application; var modelListView = application.Model.Views.OfType <IModelListView>().First(); var modelModelMap = (IModelModelMap)modelListView.MapNode(typeToMap); modelModelMap.SetValue(nameof(StringValueTypeProperties.RwString), "test"); var stringValueTypeProperties = new StringValueTypeProperties(); modelModelMap.BindTo(stringValueTypeProperties); stringValueTypeProperties.RwString.ShouldBe("test"); }
internal void Bind_all_public_rw_string_properties(Platform platform) { Type typeToMap = typeof(StringValueTypeProperties); InitializeMapperService($"{nameof(Bind_all_public_rw_string_properties)}{typeToMap.Name}{platform}"); var module = typeToMap.Extend <IModelListView>(); var application = DefaultModelMapperModule(platform, module).Application; var modelListView = application.Model.Views.OfType <IModelListView>().First(); var modelModelMap = (IModelModelMap)modelListView.MapNode(typeToMap); modelModelMap.SetValue(nameof(StringValueTypeProperties.RWString), "test"); var stringValueTypeProperties = new StringValueTypeProperties(); modelModelMap.BindTo(stringValueTypeProperties); stringValueTypeProperties.RWString.ShouldBe("test"); }
public void Bind_all_public_nullable_type_properties(string platformName) { var platform = GetPlatform(platformName); Type typeToMap = typeof(StringValueTypeProperties); InitializeMapperService($"{nameof(Bind_all_public_nullable_type_properties)}{typeToMap.Name}{platform}"); using (var module = typeToMap.Extend <IModelListView>()){ using (var application = DefaultModelMapperModule(nameof(Bind_all_public_nullable_type_properties), platform, module).Application){ var modelListView = application.Model.Views.OfType <IModelListView>().First(); var modelModelMap = (IModelModelMap)modelListView.MapNode(typeToMap); modelModelMap.SetValue(nameof(StringValueTypeProperties.RWInteger), 100); modelModelMap.SetValue(nameof(StringValueTypeProperties.NullAbleRWInteger), 200); var stringValueTypeProperties = new StringValueTypeProperties(); modelModelMap.BindTo(stringValueTypeProperties); stringValueTypeProperties.RWInteger.ShouldBe(100); stringValueTypeProperties.NullAbleRWInteger.ShouldBe(200); } } }
public void Do_not_bind_Disable_mode_nodes(string platformName) { var platform = GetPlatform(platformName); var typeToMap = typeof(StringValueTypeProperties); InitializeMapperService(); using var module = typeToMap.Extend <IModelListView>(); using var application = DefaultModelMapperModule(platform, module).Application; var modelListView = application.Model.Views.OfType <IModelListView>().First(); var modelModelMap = (IModelModelMap)modelListView.MapNode(typeToMap); modelModelMap.SetValue(nameof(StringValueTypeProperties.RwInteger), 100); var stringValueTypeProperties = new StringValueTypeProperties { RwString = "shouldNotChange" }; modelModelMap.NodeDisabled = true; modelModelMap.BindTo(stringValueTypeProperties); stringValueTypeProperties.RwString.ShouldBe("shouldNotChange"); stringValueTypeProperties.RwInteger.ShouldBe(0); }
internal void Do_not_bind_Disable_mode_nodes(Platform platform) { Type typeToMap = typeof(StringValueTypeProperties); InitializeMapperService($"{nameof(Do_not_bind_Disable_mode_nodes)}{typeToMap.Name}{platform}"); var module = typeToMap.Extend <IModelListView>(); var application = DefaultModelMapperModule(platform, module).Application; var modelListView = application.Model.Views.OfType <IModelListView>().First(); var modelModelMap = (IModelModelMap)modelListView.MapNode(typeToMap); modelModelMap.SetValue(nameof(StringValueTypeProperties.RWInteger), 100); var stringValueTypeProperties = new StringValueTypeProperties { RWString = "shouldnotchange" }; modelModelMap.NodeDisabled = true; modelModelMap.BindTo(stringValueTypeProperties); stringValueTypeProperties.RWString.ShouldBe("shouldnotchange"); stringValueTypeProperties.RWInteger.ShouldBe(0); }
internal void Bind_Only_NullAble_Properties_That_are_not_Null(Platform platform) { var typeToMap = typeof(StringValueTypeProperties); InitializeMapperService($"{nameof(Bind_Only_NullAble_Properties_That_are_not_Null)}{typeToMap.Name}{platform}"); var module = typeToMap.Extend <IModelListView>(); var application = DefaultModelMapperModule(platform, module).Application; var modelListView = application.Model.Views.OfType <IModelListView>().First(); var modelModelMap = (IModelModelMap)modelListView.MapNode(typeToMap); modelModelMap.SetValue(nameof(StringValueTypeProperties.RWInteger), 100); var stringValueTypeProperties = new StringValueTypeProperties { RWString = "shouldnotchange" }; modelModelMap.BindTo(stringValueTypeProperties); stringValueTypeProperties.RWInteger.ShouldBe(100); stringValueTypeProperties.RWString.ShouldBe("shouldnotchange"); }
public ReferenceTypeProperties() { RStringValueTypeProperties = new StringValueTypeProperties(); }