Skip to content

Commit

Permalink
Added ExpectAsync methods to sample app. updated versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
wiwanek committed Mar 13, 2014
1 parent 1819d01 commit 12748f3
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
33 changes: 31 additions & 2 deletions ExampleApp/Program.cs
Expand Up @@ -36,16 +36,45 @@ static void Main(string[] args)
Console.WriteLine("Timeout 8.8.8.8!");
}
spawn.SetTimeout(5000);
spawn.Expect(@">", () => spawn.Send("ping 8.8.4.4\n"));
spawn.Send("ping 8.8.4.4\n");
try
{
spawn.Expect("Ping statistics", s => Console.WriteLine(s));
spawn.Expect("Ping statistics for 8.8.4.4", s => Console.WriteLine(s));
for (int i = 0; i < 6; i++)
{
Console.WriteLine(i);
Thread.Sleep(1000);
}
}
catch (System.TimeoutException)
{
Console.WriteLine("Timeout 8.8.4.4!");
}

Console.WriteLine("Using ExpectAsync");
spawn.Send("ping 8.8.8.8\n");
spawn.Send("ping google.com\n");
try
{
spawn.ExpectAsync("Ping statistics for 8.8.8.8", s => Console.WriteLine(s));
for (int i = 0; i < 6; i++)
{
Console.WriteLine(i);
Thread.Sleep(1000);
}
spawn.ExpectAsync("Ping statistics for", s => Console.WriteLine(s));
for (int i = 0; i < 6; i++)
{
Console.WriteLine(i);
Thread.Sleep(1000);
}

}
catch (System.TimeoutException)
{
Console.WriteLine("Timeout 8.8.8.8!");
}

}
catch (Exception e)
{
Expand Down
4 changes: 2 additions & 2 deletions Expect.NET/Properties/AssemblyInfo.cs
Expand Up @@ -37,5 +37,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.2.1.")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
6 changes: 3 additions & 3 deletions build.ps1
Expand Up @@ -4,11 +4,11 @@ properties {
$build_dir = "$base_dir\build"
$buildartifacts_dir = "$build_dir\"
$sln_file = "$base_dir\Expect.NET.sln"
$major = 1
$minor = 2
$major = 2
$minor = 0
$patch = 0
$build = 0
$label = ""
$label = "beta"
$version_assembly = "$major.$minor.$patch.$build"
$version_nuget = "$major.$minor.$patch"
if ( $label -ne "" ) {
Expand Down

0 comments on commit 12748f3

Please sign in to comment.