public void ComponentEditorPage_ApplyChanges_Invoke_CallsSaveComponent(bool loadRequired)
        {
            var page = new SubComponentEditorPage
            {
                LoadRequired = loadRequired
            };

            page.ApplyChanges();
            Assert.Equal(1, page.SaveComponentCallCount);
            Assert.Equal(0, page.Loading);
            Assert.Equal(loadRequired, page.LoadRequired);

            // Call again.
            page.ApplyChanges();
            Assert.Equal(2, page.SaveComponentCallCount);
            Assert.Equal(0, page.Loading);
            Assert.Equal(loadRequired, page.LoadRequired);
        }
Example #2
0
        public void ComponentEditorPage_ApplyChanges_Invoke_CallsSaveComponent(bool loadRequired)
        {
            using var control = new SubComponentEditorPage
                  {
                      LoadRequired = loadRequired
                  };
            control.ApplyChanges();
            Assert.Equal(1, control.SaveComponentCallCount);
            Assert.Equal(0, control.Loading);
            Assert.Equal(loadRequired, control.LoadRequired);
            Assert.False(control.IsHandleCreated);

            // Call again.
            control.ApplyChanges();
            Assert.Equal(2, control.SaveComponentCallCount);
            Assert.Equal(0, control.Loading);
            Assert.Equal(loadRequired, control.LoadRequired);
            Assert.False(control.IsHandleCreated);
        }