Skip to content

Commit

Permalink
Release 1.0.0 (#35)
Browse files Browse the repository at this point in the history
* Added additional unit tests and bumped version to 1.0.0
  • Loading branch information
MilleBo authored Jun 7, 2017
1 parent 3552320 commit a0c7427
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Testura.Android.Device.Ui.Nodes;
using Testura.Android.Device.Ui.Nodes.Data;
using Testura.Android.Device.Ui.Search;
using Testura.Android.Util.Exceptions;

namespace Testura.Android.Tests.Device.UiAutomator.Ui.Util
{
Expand All @@ -18,6 +19,8 @@ public void SetUp()
{
_nodes = new List<Node>
{
new Node(new XElement("node", new XAttribute("package", "myPackage")), null),
new Node(new XElement("node", new XAttribute("index", 1)), null),
new Node(new XElement("node", new XAttribute("text", "Buss")), null),
new Node(new XElement("node", new XAttribute("resource-id", "android:id/search_src_text")), null),
new Node(new XElement("node", new XAttribute("content-desc", "Number_ListItem_Container")), null),
Expand All @@ -30,10 +33,17 @@ public void SetUp()


[Test]
public void NodeChecker_WhenGettingNodeThatExist_ShouldReturnNode()
public void NodeChecker_WhenGettingNodeThatDontExist_ShouldThrowException()
{
var node = _nodeFinder.FindNodes(_nodes, With.Text("Buss"));
Assert.IsNotNull(node);
Assert.Throws<UiNodeNotFoundException>(() => _nodeFinder.FindNodes(_nodes, With.Text("fdsfsdf")));
}

[Test]
public void NodeChecker_WhenGettingNodeWithText_ShouldReturnNode()
{
var foundNode = _nodeFinder.FindNode(_nodes, With.Text("Buss"));
Assert.IsNotNull(foundNode);
Assert.AreEqual("Buss", foundNode.Text);
}


Expand All @@ -42,13 +52,39 @@ public void NodeChecker_WhenGettingNodeWithResourceId_ShouldReturnNode()
{
var foundNode = _nodeFinder.FindNode(_nodes, With.ResourceId("android:id/search_src_text"));
Assert.IsNotNull(foundNode);
Assert.AreEqual("android:id/search_src_text", foundNode.ResourceId);
}

[Test]
public void NodeChecker_WhenGettingNodeWithContentDesc_ShouldReturnNode()
{
var foundNode = _nodeFinder.FindNode(_nodes, With.ContentDesc("Number_ListItem_Container"));
Assert.IsNotNull(foundNode);
Assert.AreEqual("Number_ListItem_Container", foundNode.ContentDesc);
}

[Test]
public void NodeChecker_WhenGettingNodeWithClass_ShouldReturnNode()
{
var foundNode = _nodeFinder.FindNode(_nodes, With.Class("android.widget.TextView"));
Assert.IsNotNull(foundNode);
Assert.AreEqual("android.widget.TextView", foundNode.Class);
}

[Test]
public void NodeChecker_WhenGettingNodeWithIndex_ShouldReturnNode()
{
var foundNode = _nodeFinder.FindNode(_nodes, With.Index(1));
Assert.IsNotNull(foundNode);
Assert.AreEqual("1", foundNode.Index);
}

[Test]
public void NodeChecker_WhenGettingNodeWithPackage_ShouldReturnNode()
{
var foundNode = _nodeFinder.FindNode(_nodes, With.Package("myPackage"));
Assert.IsNotNull(foundNode);
Assert.AreEqual("myPackage", foundNode.Package);
}

[Test]
Expand Down
4 changes: 2 additions & 2 deletions src/Testura.Android/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.12.1.0")]
[assembly: AssemblyFileVersion("0.12.1.0")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

0 comments on commit a0c7427

Please sign in to comment.