public void AdditinalSettings_should_be_overwritten() { // arrange var to = new ModelMetadataItem(); var settings = new DummyAdditinalSettings { Name = "val" }; to.AdditionalSettings.Add(settings); var from = new ModelMetadataItem(); var settings2 = new DummyAdditinalSettings { Name = "val2" }; from.AdditionalSettings.Add(settings2); // act from.MergeTo(to); // assert var item = to.GetAdditionalSetting <DummyAdditinalSettings>(); Assert.NotNull(item); Assert.Equal("val", item.Name); }
public void AdditinalSettings_should_set_if_it_was_added_for_from_metadata() { // arrange var to = new ModelMetadataItem(); var from = new ModelMetadataItem(); var settings = new DummyAdditinalSettings { Name = "val2" }; from.AdditionalSettings.Add(settings); // act from.MergeTo(to); // assert var item = to.GetAdditionalSetting<DummyAdditinalSettings>(); Assert.NotNull(item); Assert.Equal("val2", item.Name); }
public void AdditinalSettings_should_not_removed() { // arrange var to = new ModelMetadataItem(); var settings = new DummyAdditinalSettings { Name = "val" }; to.AdditionalSettings.Add(settings); var from = new ModelMetadataItem(); // act from.MergeTo(to); // assert var item = to.GetAdditionalSetting<DummyAdditinalSettings>(); Assert.NotNull(item); Assert.Equal("val", item.Name); }
public void AdditinalSettings_should_set_if_it_was_added_for_from_metadata() { // arrange var to = new ModelMetadataItem(); var from = new ModelMetadataItem(); var settings = new DummyAdditinalSettings { Name = "val2" }; from.AdditionalSettings.Add(settings); // act from.MergeTo(to); // assert var item = to.GetAdditionalSetting <DummyAdditinalSettings>(); Assert.NotNull(item); Assert.Equal("val2", item.Name); }