Releases: wiwanek/Expect.NET
Expect for .NET 2.0.1
Expect for .NET version 2.0.0
Redesigned API, fixed problems with VB.NET
Changes are not backward compatible:
- changed namespace name
- replaced timeout getter/setter methods with property
- updates in build script
Sample code in C#:
class Program
{
static void Main(string[] args)
{
try
{
ISession spawn = Expect.Expect.Spawn(new ProcessSpawnable("cmd.exe"));
spawn.Expect(">", s => Console.WriteLine("got: " + s));
spawn.Send("dir c:\\\n");
spawn.Expect("Program", (s) => Console.WriteLine("found: " + s));
}
catch (Exception e)
{
Console.Error.WriteLine(e);
}
Console.ReadKey();
}
}
Sample code in VB.NET:
Imports Expect
Module Module1
Sub Main()
Dim session As ISession = Expect.Expect.Spawn(New ProcessSpawnable("cmd.exe"))
Try
session.Expect(">", Sub(s) Console.WriteLine("Prompt --> " + s))
session.SetTimeout(1000)
session.Send("dir c:\" + Environment.NewLine)
session.Expect("Program Files", Sub(s) Console.WriteLine(s))
session.Expect(">", Sub() session.Send("ping 8.8.8.8" + Environment.NewLine))
Catch ex As System.TimeoutException
Console.WriteLine("Timeout")
End Try
session.SetTimeout(5000)
session.Expect("Lost = 0", Sub() session.Send("ping 8.8.8.8" + Environment.NewLine))
session.Expect("Lost = 0", Sub(s) Console.WriteLine(s))
Console.WriteLine("Done")
Console.ReadKey()
End Sub
End Module
Expect for .NET 2.0.0-rc
Release candidate of version 2.0.0
Changes are not backward compatible:
- changed namespace name
- replaced timeout getter/setter methods with property
- updates in build script
Expect for .NET 2.0.0-beta released
Redesigned API, fixed problems with VB.NET
Sample code in C#:
class Program
{
static void Main(string[] args)
{
try
{
ISession spawn = Expect.Expect.Spawn(new ProcessSpawnable("cmd.exe"));
spawn.Expect(">", s => Console.WriteLine("got: " + s));
spawn.Send("dir c:\\\n");
spawn.Expect("Program", (s) => Console.WriteLine("found: " + s));
}
catch (Exception e)
{
Console.Error.WriteLine(e);
}
Console.ReadKey();
}
}
Sample code in VB.NET:
Imports Expect
Module Module1
Sub Main()
Dim session As ISession = Expect.Expect.Spawn(New ProcessSpawnable("cmd.exe"))
Try
session.Expect(">", Sub(s) Console.WriteLine("Prompt --> " + s))
session.SetTimeout(1000)
session.Send("dir c:\" + Environment.NewLine)
session.Expect("Program Files", Sub(s) Console.WriteLine(s))
session.Expect(">", Sub() session.Send("ping 8.8.8.8" + Environment.NewLine))
Catch ex As System.TimeoutException
Console.WriteLine("Timeout")
End Try
session.SetTimeout(5000)
session.Expect("Lost = 0", Sub() session.Send("ping 8.8.8.8" + Environment.NewLine))
session.Expect("Lost = 0", Sub(s) Console.WriteLine(s))
Console.WriteLine("Done")
Console.ReadKey()
End Sub
End Module
Expect for .NET 1.2.0
Versioning
I was looking for good versioning system for Expect for .NET and finally I found Semantic Versioning version 2.0.0 http://semver.org/spec/v2.0.0.html. From now this versioning will be used.
Compatibility
According to SemVer rules when the backward incompatible changes are introduced the major version must be stepped. Previous Expect for .NET releases had problems with backward compatibility, so all of them are fixed in current release.
The 1.2.0 release is backward compatible with all previous releases!
Changes
- Updated build script for Semantic Versioning
- Reverted incompatible changes and marked as obsolete.
Release 1.1.38
- Created build scripts
- Replaced Expect.TimeoutException with System.TimeoutException
- Added async ExpectAsync methods
- Added documentation comments
- Reimplemented Expect methods to be fully synchronous instead of async wrappers
Fixed naming convention
Changelog
Compatibility
The release v1.0.1 is not compatible with v1.0.0 - there were changed element names to follow rules in core .NET packages. There were no changes in logic. To adapt code to v1.0.1 it is enough to replace old names to new ones.
First released version
First released version of Expect.NET library.
Currently supported is controlling of local shell application from .NET code.