From 12748f3b8336f29200239c1c0d51f7915a1aaa90 Mon Sep 17 00:00:00 2001 From: Wojtek Iwanek Date: Thu, 13 Mar 2014 23:23:28 +0100 Subject: [PATCH] Added ExpectAsync methods to sample app. updated versions. --- ExampleApp/Program.cs | 33 +++++++++++++++++++++++++-- Expect.NET/Properties/AssemblyInfo.cs | 4 ++-- build.ps1 | 6 ++--- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/ExampleApp/Program.cs b/ExampleApp/Program.cs index e5d8cf3..45275f8 100644 --- a/ExampleApp/Program.cs +++ b/ExampleApp/Program.cs @@ -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) { diff --git a/Expect.NET/Properties/AssemblyInfo.cs b/Expect.NET/Properties/AssemblyInfo.cs index be9ff67..6e5d6df 100644 --- a/Expect.NET/Properties/AssemblyInfo.cs +++ b/Expect.NET/Properties/AssemblyInfo.cs @@ -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")] diff --git a/build.ps1 b/build.ps1 index ac7a674..b8a032e 100644 --- a/build.ps1 +++ b/build.ps1 @@ -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 "" ) {