Skip to content

Releases: wiwanek/Expect.NET

Expect for .NET 2.0.1

29 Jul 23:01
Compare
Choose a tag to compare

Replacing expected string matching. Regex matching replaced with regular string matching. Regex here may be confusing it wasn't mentioned in documentation.

Expect for .NET version 2.0.0

06 Jul 12:38
Compare
Choose a tag to compare

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

15 May 18:55
Compare
Choose a tag to compare
Pre-release

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

13 Mar 22:52
Compare
Choose a tag to compare
Pre-release

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

30 Jan 23:06
Compare
Choose a tag to compare

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

21 Jan 13:13
Compare
Choose a tag to compare
  • 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

12 Jan 01:11
Compare
Choose a tag to compare

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

13 Dec 18:15
Compare
Choose a tag to compare

First released version of Expect.NET library.
Currently supported is controlling of local shell application from .NET code.