public void Transform_DoesNotImplementOtherPatterns() { var element = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTransformPattern(new PatternsData()) }) as ISupportsValuePattern; MbUnit.Framework.Assert.IsNull(element as ISupportsValuePattern); Assert.Null(element as ISupportsValuePattern); }
public void Transform_CanRotate() { // Arrange const bool expectedValue = true; var element = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTransformPattern(new PatternsData() { TransformPattern_CanRotate = expectedValue }) }) as ISupportsTransformPattern; // Act // Assert MbUnit.Framework.Assert.AreEqual(expectedValue, element.CanRotate); Assert.Equal(expectedValue, element.CanRotate); }
public void Transform_Rotate() { // Arrange const bool expectedResult = true; bool result = false; var element = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTransformPattern(new PatternsData()) }) as ISupportsTransformPattern; // Act element.Rotate(1); try { (element as IUiElement).GetCurrentPattern <ITransformPattern>(TransformPattern.Pattern).Received(1).Rotate(1); result = true; } catch {} // Assert MbUnit.Framework.Assert.AreEqual(expectedResult, result); Assert.Equal(expectedResult, result); }
public void Transform_ImplementsCommonPattern() { // ISupportsInvokePattern invokableElement = // FakeFactory.GetAutomationElementForMethodsOfObjectModel( // new IBasePattern[] { FakeFactory.GetTransformPattern(new PatternsData()) }) as ISupportsInvokePattern; // // MbUnit.Framework.Assert.IsNotNull(invokableElement as ISupportsInvokePattern); var highlightableElement = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTransformPattern(new PatternsData()) }) as ISupportsHighlighter; MbUnit.Framework.Assert.IsNotNull(highlightableElement as ISupportsHighlighter); Assert.NotNull(highlightableElement as ISupportsHighlighter); var navigatableElement = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTransformPattern(new PatternsData()) }) as ISupportsNavigation; MbUnit.Framework.Assert.IsNotNull(navigatableElement as ISupportsNavigation); Assert.NotNull(navigatableElement as ISupportsNavigation); var conversibleElement = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTransformPattern(new PatternsData()) }) as ISupportsConversion; MbUnit.Framework.Assert.IsNotNull(conversibleElement as ISupportsConversion); Assert.NotNull(conversibleElement as ISupportsConversion); var refreshableElement = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTransformPattern(new PatternsData()) }) as ISupportsRefresh; MbUnit.Framework.Assert.IsNotNull(refreshableElement as ISupportsRefresh); Assert.NotNull(refreshableElement as ISupportsRefresh); }