Exemplo n.º 1
0
            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("{"));
            }
Exemplo n.º 2
0
            public void WhenChangingSettingsValue_ThenAutomaticallySerializesValue()
            {
                var value = "";
                var property = new BoundProperty("Name", () => value, s => value = s);

                property.Settings.Value = "Hello";

                Assert.NotEqual("", value);
            }
Exemplo n.º 3
0
            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);
            }
Exemplo n.º 4
0
            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"));
            }
Exemplo n.º 5
0
 public void InitializeContext()
 {
     this.property = new BoundProperty("Property",
             () => this.Property,
             s => this.Property = s);
 }
Exemplo n.º 6
0
            public void WhenValueIsEmpty_ThenSettingsInitializedEmpty()
            {
                var property = new BoundProperty("Name", () => "", s => { });

                Assert.Equal("", property.Settings.Value);
            }
Exemplo n.º 7
0
            public void WhenInitializingSettings_ThenHasPropertyName()
            {
                var property = new BoundProperty("Name", () => "", s => { });

                Assert.Equal("Name", property.Settings.Name);
            }