public void WhenExistingLegacyRawValueExists_ThenAutomaticallyUpgradesToBindingValue() { var value = "Foo"; var property = new BoundProperty("Name", () => value, s => value = s); Assert.Equal("Foo", property.Settings.Value); Assert.True(value.Trim().StartsWith("{")); }
public void WhenChangingSettingsValue_ThenAutomaticallySerializesValue() { var value = ""; var property = new BoundProperty("Name", () => value, s => value = s); property.Settings.Value = "Hello"; Assert.NotEqual("", value); }
public void WhenReassigningSettings_ThenSavesNewValue() { var value = ""; var property = new BoundProperty("Name", () => value, s => value = s); var settings = property.Settings; property.Settings = new PropertyBindingSettings { Name = "Name", Value = "Hello" }; Assert.NotEqual("", value); }
public void WhenReassigningSettings_ThenDetachesChangesFromOlder() { var value = ""; var property = new BoundProperty("Name", () => value, s => value = s); var settings = property.Settings; property.Settings = new PropertyBindingSettings { Name = "Name", Value = "Hello" }; settings.Value = "Foo"; Assert.False(value.Contains("Foo")); }
public void InitializeContext() { this.property = new BoundProperty("Property", () => this.Property, s => this.Property = s); }
public void WhenValueIsEmpty_ThenSettingsInitializedEmpty() { var property = new BoundProperty("Name", () => "", s => { }); Assert.Equal("", property.Settings.Value); }
public void WhenInitializingSettings_ThenHasPropertyName() { var property = new BoundProperty("Name", () => "", s => { }); Assert.Equal("Name", property.Settings.Name); }