[NUnit.Framework.Test] // [MbUnit.Framework.Test][NUnit.Framework.Test][Fact] public void Table_DoesNotImplementOtherPatterns() { var element = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTablePattern(new PatternsData()) }) as ISupportsValuePattern; MbUnit.Framework.Assert.IsNull(element as ISupportsValuePattern); Assert.Null(element as ISupportsValuePattern); }
[NUnit.Framework.Test] // [MbUnit.Framework.Test][NUnit.Framework.Test][Fact] public void Table_ImplementsPatternInQuestion() { var element = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTablePattern(new PatternsData()) }) as ISupportsTablePattern; MbUnit.Framework.Assert.IsNotNull(element as ISupportsTablePattern); Assert.NotNull(element as ISupportsTablePattern); }
[NUnit.Framework.Test] // [MbUnit.Framework.Test][NUnit.Framework.Test][Fact] public void Table_RowOrColumnMajor() { // Arrange RowOrColumnMajor expectedValue = RowOrColumnMajor.ColumnMajor; var element = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTablePattern(new PatternsData() { TablePattern_RowOrColumnMajor = expectedValue }) }) as ISupportsTablePattern; // Act // Assert MbUnit.Framework.Assert.AreEqual(expectedValue, element.RowOrColumnMajor); Assert.Equal(expectedValue, element.RowOrColumnMajor); }
[NUnit.Framework.Test] // [MbUnit.Framework.Test][NUnit.Framework.Test][Fact] public void Table_TableRowCount() { // Arrange const int expectedValue = 8; var element = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTablePattern(new PatternsData() { TablePattern_RowCount = expectedValue }) }) as ISupportsTablePattern; // Act // Assert MbUnit.Framework.Assert.AreEqual(expectedValue, element.TableRowCount); Assert.Equal(expectedValue, element.TableRowCount); }
[NUnit.Framework.Test] // [MbUnit.Framework.Test][NUnit.Framework.Test][Fact] public void Table_GetRowHeaders() { // Arrange const bool expectedResult = true; bool result = false; var element = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTablePattern(new PatternsData()) }) as ISupportsTablePattern; // Act element.GetRowHeaders(); try { (element as IUiElement).GetCurrentPattern <ITablePattern>(TablePattern.Pattern).Current.Received(1).GetRowHeaders(); 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 Table_ImplementsCommonPattern() { // ISupportsInvokePattern invokableElement = // FakeFactory.GetAutomationElementForMethodsOfObjectModel( // new IBasePattern[] { FakeFactory.GetTablePattern(new PatternsData()) }) as ISupportsInvokePattern; // // MbUnit.Framework.Assert.IsNotNull(invokableElement as ISupportsInvokePattern); var highlightableElement = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTablePattern(new PatternsData()) }) as ISupportsHighlighter; MbUnit.Framework.Assert.IsNotNull(highlightableElement as ISupportsHighlighter); Assert.NotNull(highlightableElement as ISupportsHighlighter); var navigatableElement = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTablePattern(new PatternsData()) }) as ISupportsNavigation; MbUnit.Framework.Assert.IsNotNull(navigatableElement as ISupportsNavigation); Assert.NotNull(navigatableElement as ISupportsNavigation); var conversibleElement = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTablePattern(new PatternsData()) }) as ISupportsConversion; MbUnit.Framework.Assert.IsNotNull(conversibleElement as ISupportsConversion); Assert.NotNull(conversibleElement as ISupportsConversion); var refreshableElement = FakeFactory.GetAutomationElementForMethodsOfObjectModel( new IBasePattern[] { FakeFactory.GetTablePattern(new PatternsData()) }) as ISupportsRefresh; MbUnit.Framework.Assert.IsNotNull(refreshableElement as ISupportsRefresh); Assert.NotNull(refreshableElement as ISupportsRefresh); }