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); }
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); }
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); }
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); }
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); }