public void ComponentEditorPage_Deactivate_InvokeActivated_SetsInvisible(bool loadRequired, int expectedLoadComponentCallCount)
        {
            var page = new SubComponentEditorPage
            {
                LoadRequired = loadRequired
            };

            page.Activate();
            Assert.Equal(expectedLoadComponentCallCount, page.LoadComponentCallCount);
            Assert.Equal(0, page.Loading);
            Assert.False(page.LoadRequired);
            Assert.True(page.Visible);

            page.Deactivate();
            Assert.Equal(expectedLoadComponentCallCount, page.LoadComponentCallCount);
            Assert.Equal(0, page.Loading);
            Assert.False(page.LoadRequired);
            Assert.False(page.Visible);

            // Call again.
            page.Deactivate();
            Assert.Equal(expectedLoadComponentCallCount, page.LoadComponentCallCount);
            Assert.Equal(0, page.Loading);
            Assert.False(page.LoadRequired);
            Assert.False(page.Visible);
        }
Beispiel #2
0
        public void ComponentEditorPage_Deactivate_InvokeActivated_SetsInvisible(bool loadRequired, int expectedLoadComponentCallCount)
        {
            using var control = new SubComponentEditorPage
                  {
                      LoadRequired = loadRequired
                  };
            control.Activate();
            Assert.Equal(expectedLoadComponentCallCount, control.LoadComponentCallCount);
            Assert.Equal(0, control.Loading);
            Assert.False(control.LoadRequired);
            Assert.True(control.Visible);
            Assert.False(control.IsHandleCreated);

            control.Deactivate();
            Assert.Equal(expectedLoadComponentCallCount, control.LoadComponentCallCount);
            Assert.Equal(0, control.Loading);
            Assert.False(control.LoadRequired);
            Assert.False(control.Visible);
            Assert.False(control.IsHandleCreated);

            // Call again.
            control.Deactivate();
            Assert.Equal(expectedLoadComponentCallCount, control.LoadComponentCallCount);
            Assert.Equal(0, control.Loading);
            Assert.False(control.LoadRequired);
            Assert.False(control.Visible);
            Assert.False(control.IsHandleCreated);
        }