public void StateTransfersOnlyChangedValues() { ResetComet(); const string textValue = "Hello"; var orgView = new MyOrgView(); var orgText = orgView.GetView() as Text; Assert.NotEqual(orgView.bindingObject.Title, textValue); orgView.bindingObject.Title = textValue; Assert.Equal(textValue, orgText.Value); //IsEnabled is defaulted to true. Assert.True(orgView.bindingObject.IsEnabled); HotReloadHelper.RegisterReplacedView(typeof(MyOrgView).FullName, typeof(MyNewView)); HotReloadHelper.TriggerReload(); var newText = orgView.GetView() as Text; Assert.NotNull(newText); var v = orgView.GetReplacedView(); var newView = v as MyNewView; Assert.IsType <MyNewView>(v); Assert.NotNull(newView); Assert.False(newView.bindingObject.IsEnabled); Assert.Equal(textValue, newView.bindingObject.Title); }
public void HotReloadRegisterReplacedViewReplacesView() { var orgView = new MyOrgView(); var orgText = orgView.GetView() as Text; Assert.Equal(MyOrgView.TextValue, orgText.Value.CurrentValue); HotReloadHelper.RegisterReplacedView(typeof(MyOrgView).FullName, typeof(MyNewView)); var newText = orgView.GetView() as Text; Assert.Equal(MyNewView.TextValue, newText.Value.CurrentValue); }
public void StateIsTransferedToReloadedView() { ResetComet(); const string textValue = "Hello"; var orgView = new MyOrgView(); var orgText = orgView.GetView() as Text; Assert.NotEqual(orgView.bindingObject.Title, textValue); orgView.bindingObject.Title = textValue; Assert.Equal(textValue, orgText.Value); HotReloadHelper.RegisterReplacedView(typeof(MyOrgView).FullName, typeof(MyNewView)); var newText = orgView.GetView() as Text; Assert.Equal(textValue, newText.Value); }