Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix test irregularities #968

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/ActionsTests/Misc/ExtensionMethodsTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Axe.Windows.Actions.Misc;
Expand All @@ -12,14 +12,14 @@

namespace Axe.Windows.ActionsTests.Misc
{
[TestClass()]
[TestClass]
public class ExtensionMethodsTests
{
/// <summary>
/// Create 10 elements with bounding rectangle (i, i, i, i) from [0, 9]
/// See which one is identified as smallest enclosing area of (5, 5)
/// </summary>
[TestMethod()]
[TestMethod]
public void GetSmallestElementFromPointTest()
{
var boundingRects = new List<System.Drawing.Rectangle>();
Expand All @@ -39,7 +39,7 @@ public void GetSmallestElementFromPointTest()
/// See which one is identified as smallest enclosing area of (5, 5)
/// Normal answer (3, 3, 3, 3) is off-screen
/// </summary>
[TestMethod()]
[TestMethod]
public void GetSmallestElementFromPointTest_Offscreen()
{
var boundingRects = new List<System.Drawing.Rectangle>();
Expand All @@ -59,7 +59,7 @@ public void GetSmallestElementFromPointTest_Offscreen()
/// Create 10 elements with bounding rectangle (i, i, i, i) from [0, 9]
/// See which one is identified as smallest enclosing area of (200, 200)
/// </summary>
[TestMethod()]
[TestMethod]
public void GetSmallestElementFromPointTest_NoneOverlaps()
{
var boundingRects = new List<System.Drawing.Rectangle>();
Expand All @@ -74,13 +74,13 @@ public void GetSmallestElementFromPointTest_NoneOverlaps()
Assert.AreEqual(null, answer);
}

[TestMethod()]
[TestMethod]
public void GetSmallestElementFromPointTest_NullArgument()
{
Assert.ThrowsException<ArgumentNullException>(() => ExtensionMethods.GetSmallestElementFromPoint(null, System.Drawing.Point.Empty));
}

[TestMethod()]
[TestMethod]
public void GetSmallestElementFromPointTest_NoElementsProvided()
{
Assert.ThrowsException<ArgumentException>(() => ExtensionMethods.GetSmallestElementFromPoint(new Dictionary<int, ICoreA11yElement>(), System.Drawing.Point.Empty));
Expand Down
2 changes: 1 addition & 1 deletion src/AutomationTests/ScanResultsAssemblerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Axe.Windows.AutomationTests
{
[TestClass()]
[TestClass]
public class ScanResultsAssemblerTests
{
readonly ScanResultsAssembler _assembler = new ScanResultsAssembler();
Expand Down
12 changes: 6 additions & 6 deletions src/CoreTests/Bases/A11yElementTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ namespace Axe.Windows.CoreTests.Bases
/// <summary>
/// Tests A11yElement class
/// </summary>
[TestClass()]
[TestClass]
public class A11yElementTests
{
[TestMethod()]
[TestMethod]
[Timeout(2000)]
public void FindDescendent_SimpleCondition_ReturnsChild()
{
Expand All @@ -31,7 +31,7 @@ public void FindDescendent_SimpleCondition_ReturnsChild()
Assert.AreEqual(result, child);
}

[TestMethod()]
[TestMethod]
[Timeout(2000)]
public void FindDescendent_SimpleCondition_ReturnsNull()
{
Expand All @@ -47,7 +47,7 @@ public void FindDescendent_SimpleCondition_ReturnsNull()
Assert.IsNull(result);
}

[TestMethod()]
[TestMethod]
[Timeout(2000)]
public void FindDescendent_SimpleCondition_ReturnsGrandchild()
{
Expand All @@ -73,7 +73,7 @@ public void FindDescendent_SimpleCondition_ReturnsGrandchild()
Assert.AreEqual(result, grandChild);
}

[TestMethod()]
[TestMethod]
[Timeout(2000)]
public void FindDescendent_SimpleConditionNonePass_ReturnsNull()
{
Expand All @@ -99,7 +99,7 @@ public void FindDescendent_SimpleConditionNonePass_ReturnsNull()
/// <summary>
/// Test various getters which use GetPropertySafely
/// </summary>
[TestMethod()]
[TestMethod]
public void GetPropertySafelyTest()
{
A11yElement element = Utility.LoadA11yElementsFromJSON("Resources/A11yElementTest.hier");
Expand Down
4 changes: 2 additions & 2 deletions src/CoreTests/Bases/A11yPatternPropertyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ namespace Axe.Windows.CoreTests.Bases
/// <summary>
/// Tests A11yPatternProperty class
/// </summary>
[TestClass()]
[TestClass]
public class A11yPatternPropertyTests
{
/// <summary>
/// Checks NodeValue string output
/// </summary>
[TestMethod()]
[TestMethod]
public void NodeValueTest()
{
A11yElement element = Utility.LoadA11yElementsFromJSON("Resources/A11yPatternTest.hier");
Expand Down
4 changes: 2 additions & 2 deletions src/CoreTests/Bases/A11yPatternTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ namespace Axe.Windows.CoreTests.Bases
/// <summary>
/// Tests A11yPattern class
/// </summary>
[TestClass()]
[TestClass]
public class A11yPatternTests
{
/// <summary>
/// Test ToString and constructor for A11yPattern
/// </summary>
[TestMethod()]
[TestMethod]
public void ToStringTest()
{
A11yElement element = Utility.LoadA11yElementsFromJSON("Resources/A11yPatternTest.hier");
Expand Down
8 changes: 4 additions & 4 deletions src/CoreTests/Bases/A11yPropertyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ namespace Axe.Windows.CoreTests.Bases
/// <summary>
/// Tests A11yProperty class
/// </summary>
[TestClass()]
[TestClass]
public class A11yPropertyTests
{
/// <summary>
/// Tests A11yProperty.ToString() through A11yProperty.TextValue.
/// Also tests constructor.
/// </summary>
[TestMethod()]
[TestMethod]
public void ToStringTest()
{
A11yElement element = Utility.LoadA11yElementsFromJSON("Resources/A11yPropertyTest.hier");
Expand All @@ -44,7 +44,7 @@ public void ToStringTest()
Assert.AreEqual("False", kpVal);
}

[TestMethod()]
[TestMethod]
public void SimpleCustomPropertyTest()
{
const int testId = 42;
Expand All @@ -55,7 +55,7 @@ public void SimpleCustomPropertyTest()
Assert.AreEqual(expectedRendering, kp.ToString());
}

[TestMethod()]
[TestMethod]
public void RegisterTwiceCustomPropertyTest()
{
const int testId = 42;
Expand Down
2 changes: 1 addition & 1 deletion src/CoreTests/CustomObjects/ConfigTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Axe.Windows.CoreTests.CustomObjects
{
[TestClass()]
[TestClass]
public class ConfigTests
{
[TestMethod, Timeout(1000)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Axe.Windows.CoreTests.CustomObjects.Converters
{
[TestClass()]
[TestClass]
public class BoolConverterTests
{
[TestMethod, Timeout(1000)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Axe.Windows.CoreTests.CustomObjects.Converters
{
[TestClass()]
[TestClass]
public class DoubleConverterTests
{
[TestMethod, Timeout(1000)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Axe.Windows.CoreTests.CustomObjects.Converters
{
[TestClass()]
[TestClass]
public class ElementConverterTests
{
[TestMethod, Timeout(1000)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Axe.Windows.CoreTests.CustomObjects.Converters
{
[TestClass()]
[TestClass]
public class EnumConverterTests
{
[TestMethod, Timeout(1000)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Axe.Windows.CoreTests.CustomObjects.Converters
{
[TestClass()]
[TestClass]
public class IntConverterTests
{
[TestMethod, Timeout(1000)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Axe.Windows.CoreTests.CustomObjects.Converters
{
[TestClass()]
[TestClass]
public class PointConverterTests
{
[TestMethod, Timeout(1000)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Axe.Windows.CoreTests.CustomObjects.Converters
{
[TestClass()]
[TestClass]
public class StringConverterTests
{
[TestMethod, Timeout(1000)]
Expand Down
2 changes: 1 addition & 1 deletion src/CoreTests/CustomObjects/CustomPropertyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Axe.Windows.CoreTests.CustomObjects
{
[TestClass()]
[TestClass]
public class CustomPropertyTests
{
[TestMethod, Timeout(1000)]
Expand Down
4 changes: 2 additions & 2 deletions src/CoreTests/Misc/MiscTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ namespace Axe.Windows.CoreTests.Misc
/// <summary>
/// Tests for the misc folder in Axe.Windows.Core
/// </summary>
[TestClass()]
[TestClass]
public class MiscTests
{
/// <summary>
/// Tests whether the aggregates status counts of a monster
/// snapshot are accurate
/// </summary>
[TestMethod()]
[TestMethod]
public void GetStatusCounts()
{
A11yElement element = UnitTestSharedLibrary.Utility.LoadA11yElementsFromJSON("Snapshots/Taskbar.snapshot");
Expand Down
6 changes: 3 additions & 3 deletions src/CoreTests/Results/ScanMetaInfoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

namespace Axe.Windows.CoreTests.Results
{
[TestClass()]
[TestClass]
public class ScanMetaInfoTests
{
/// <summary>
/// Test with PropertyId Set
/// </summary>
[TestMethod()]
[TestMethod]
public void ScanMetaInfoTest()
{
A11yElement e = new A11yElement
Expand All @@ -37,7 +37,7 @@ public void ScanMetaInfoTest()
/// <summary>
/// Test without PropertyId
/// </summary>
[TestMethod()]
[TestMethod]
public void ScanMetaInfoTest2()
{
A11yElement e = new A11yElement
Expand Down
8 changes: 4 additions & 4 deletions src/CoreTests/Types/ControlTypesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@

namespace Axe.Windows.CoreTests.Types
{
[TestClass()]
[TestClass]
public class ControlTypesTest
{
[TestMethod()]
[TestMethod]
public void CheckExists()
{
Assert.AreEqual(true, ControlType.GetInstance().Exists(ControlType.UIA_AppBarControlTypeId));
Assert.AreEqual(false, ControlType.GetInstance().Exists(0));
}

[TestMethod()]
[TestMethod]
public void CheckGetNameById()
{
Assert.AreEqual("AppBar(50040)", ControlType.GetInstance().GetNameById(ControlType.UIA_AppBarControlTypeId));
}

[TestMethod()]
[TestMethod]
[Timeout(1000)]
public void CheckHasExpectedValues()
{
Expand Down