コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }