Esempio n. 1
0
        public void Value_DoesNotImplementOtherPatterns()
        {
            var element =
                FakeFactory.GetAutomationElementForMethodsOfObjectModel(
                    new IBasePattern[] { FakeFactory.GetValuePattern(new PatternsData()) }) as ISupportsDockPattern;

            MbUnit.Framework.Assert.IsNull(element as ISupportsDockPattern);
            Assert.Null(element as ISupportsDockPattern);
        }
Esempio n. 2
0
        public void Value_ImplementsPatternInQuestion()
        {
            var element =
                FakeFactory.GetAutomationElementForMethodsOfObjectModel(
                    new IBasePattern[] { FakeFactory.GetValuePattern(new PatternsData()) }) as ISupportsValuePattern;

            MbUnit.Framework.Assert.IsNotNull(element as ISupportsValuePattern);
            Assert.NotNull(element as ISupportsValuePattern);
        }
Esempio n. 3
0
        public void Value_Value_Get()
        {
            // Arrange
            const string expectedValue = "abc";
            var          element       =
                FakeFactory.GetAutomationElementForMethodsOfObjectModel(
                    new IBasePattern[] { FakeFactory.GetValuePattern(new PatternsData()
                {
                    ValuePattern_Value = expectedValue
                }) }) as ISupportsValuePattern;

            // Act
            // Assert
            MbUnit.Framework.Assert.AreEqual(expectedValue, element.Value);
            Assert.Equal(expectedValue, element.Value);
        }
Esempio n. 4
0
        public void Value_Value_Set()
        {
            // Arrange
            const string expectedValue = "abc";
            var          element       =
                FakeFactory.GetAutomationElementForMethodsOfObjectModel(
                    new IBasePattern[] { FakeFactory.GetValuePattern(new PatternsData()) }) as ISupportsValuePattern;

            // Act
            element.Value = expectedValue;
            try {
                (element as IUiElement).GetCurrentPattern <IValuePattern>(ValuePattern.Pattern).Received(1).SetValue(expectedValue);
                element.Value.Returns(expectedValue);
            }
            catch {}

            // Assert
            MbUnit.Framework.Assert.AreEqual(expectedValue, element.Value);
            Assert.Equal(expectedValue, element.Value);
        }
Esempio n. 5
0
        public void Value_ImplementsCommonPattern()
        {
//            ISupportsInvokePattern invokableElement =
//                FakeFactory.GetAutomationElementForMethodsOfObjectModel(
//                    new IBasePattern[] { FakeFactory.GetValuePattern(new PatternsData()) }) as ISupportsInvokePattern;
//
//            MbUnit.Framework.Assert.IsNotNull(invokableElement as ISupportsInvokePattern);

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

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

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

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

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

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

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

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