[NUnit.Framework.Test] // [MbUnit.Framework.Test][NUnit.Framework.Test][Fact]
        public void Window_ImplementsPatternInQuestion()
        {
            var element =
                FakeFactory.GetAutomationElementForMethodsOfObjectModel(
                    new IBasePattern[] { FakeFactory.GetWindowPattern(new PatternsData()) }) as ISupportsWindowPattern;

            MbUnit.Framework.Assert.IsNotNull(element as ISupportsWindowPattern);
            Assert.NotNull(element as ISupportsWindowPattern);
        }
        [NUnit.Framework.Test] // [MbUnit.Framework.Test][NUnit.Framework.Test][Fact]
        public void Window_DoesNotImplementOtherPatterns()
        {
            var element =
                FakeFactory.GetAutomationElementForMethodsOfObjectModel(
                    new IBasePattern[] { FakeFactory.GetWindowPattern(new PatternsData()) }) as ISupportsValuePattern;

            MbUnit.Framework.Assert.IsNull(element as ISupportsValuePattern);
            Assert.Null(element as ISupportsValuePattern);
        }
 public void Window_WindowVisualState()
 {
     // Arrange
     var expectedValue = WindowVisualState.Normal;
     var element =
         FakeFactory.GetAutomationElementForMethodsOfObjectModel(
             new IBasePattern[] { FakeFactory.GetWindowPattern(new PatternsData() { WindowPattern_WindowVisualState = expectedValue }) }) as ISupportsWindowPattern;
     
     // Act
     
     // Assert
     MbUnit.Framework.Assert.AreEqual(expectedValue, element.WindowVisualState);
     Assert.Equal(expectedValue, element.WindowVisualState);
 }
 public void Window_IsTopmost()
 {
     // Arrange
     const bool expectedValue = false;
     var element =
         FakeFactory.GetAutomationElementForMethodsOfObjectModel(
             new IBasePattern[] { FakeFactory.GetWindowPattern(new PatternsData() { WindowPattern_IsTopmost = expectedValue }) }) as ISupportsWindowPattern;
     
     // Act
     
     // Assert
     MbUnit.Framework.Assert.AreEqual(expectedValue, element.IsTopmost);
     Assert.Equal(expectedValue, element.IsTopmost);
 }
        [NUnit.Framework.Test] // [MbUnit.Framework.Test][NUnit.Framework.Test][Fact]
        public void Window_SetWindowVisualState()
        {
            // Arrange
            var expectedValue = WindowVisualState.Minimized;
            var element       =
                FakeFactory.GetAutomationElementForMethodsOfObjectModel(
                    new IBasePattern[] { FakeFactory.GetWindowPattern(new PatternsData()) }) as ISupportsWindowPattern;

            // Act
            element.SetWindowVisualState(expectedValue);
            try {
                (element as IUiElement).GetCurrentPattern <IWindowPattern>(WindowPattern.Pattern).Received(1).SetWindowVisualState(expectedValue);
                element.WindowVisualState.Returns(expectedValue);
            }
            catch {}

            // Assert
            MbUnit.Framework.Assert.AreEqual(expectedValue, element.WindowVisualState);
            Assert.Equal(expectedValue, element.WindowVisualState);
        }
        [NUnit.Framework.Test] // [MbUnit.Framework.Test][NUnit.Framework.Test][Fact]
        public void Window_WaitForInputIdle()
        {
            // Arrange
            const bool expectedResult = true;
            bool       result         = false;
            var        element        =
                FakeFactory.GetAutomationElementForMethodsOfObjectModel(
                    new IBasePattern[] { FakeFactory.GetWindowPattern(new PatternsData()) }) as ISupportsWindowPattern;

            // Act
            element.WaitForInputIdle(1);
            try {
                (element as IUiElement).GetCurrentPattern <IWindowPattern>(WindowPattern.Pattern).Received(1).WaitForInputIdle(1);
                result = true;
            }
            catch {}

            // Assert
            MbUnit.Framework.Assert.AreEqual(expectedResult, result);
            Assert.Equal(expectedResult, result);
        }
        [NUnit.Framework.Test] // [MbUnit.Framework.Test][NUnit.Framework.Test][Fact]
        public void Window_ImplementsCommonPattern()
        {
//            ISupportsInvokePattern invokableElement =
//                FakeFactory.GetAutomationElementForMethodsOfObjectModel(
//                    new IBasePattern[] { FakeFactory.GetWindowPattern(new PatternsData()) }) as ISupportsInvokePattern;
//
//            MbUnit.Framework.Assert.IsNotNull(invokableElement as ISupportsInvokePattern);

            var highlightableElement =
                FakeFactory.GetAutomationElementForMethodsOfObjectModel(
                    new IBasePattern[] { FakeFactory.GetWindowPattern(new PatternsData()) }) as ISupportsHighlighter;

            MbUnit.Framework.Assert.IsNotNull(highlightableElement as ISupportsHighlighter);
            Assert.NotNull(highlightableElement as ISupportsHighlighter);

            var navigatableElement =
                FakeFactory.GetAutomationElementForMethodsOfObjectModel(
                    new IBasePattern[] { FakeFactory.GetWindowPattern(new PatternsData()) }) as ISupportsNavigation;

            MbUnit.Framework.Assert.IsNotNull(navigatableElement as ISupportsNavigation);
            Assert.NotNull(navigatableElement as ISupportsNavigation);

            var conversibleElement =
                FakeFactory.GetAutomationElementForMethodsOfObjectModel(
                    new IBasePattern[] { FakeFactory.GetWindowPattern(new PatternsData()) }) as ISupportsConversion;

            MbUnit.Framework.Assert.IsNotNull(conversibleElement as ISupportsConversion);
            Assert.NotNull(conversibleElement as ISupportsConversion);

            var refreshableElement =
                FakeFactory.GetAutomationElementForMethodsOfObjectModel(
                    new IBasePattern[] { FakeFactory.GetWindowPattern(new PatternsData()) }) as ISupportsRefresh;

            MbUnit.Framework.Assert.IsNotNull(refreshableElement as ISupportsRefresh);
            Assert.NotNull(refreshableElement as ISupportsRefresh);
        }