If a user is allowed to create their own driver, then the CreateDriver method must be adapted to start it properly. If this is not allowed and only existing drivers can be initialized, then it would be advisable to remove the driver parameter from Application.Init.
What is your opinion on this?
Here an unit test proving the current behavior:
[Fact]
public void Application_Init_Driver_Not_Null_Initialize_Windows_Or_Unix_ComponentFactory ()
{
IDriver driver = CreateFakeDriver ();
Assert.NotNull (driver);
Application.Init (driver);
Assert.NotNull (Application.Driver);
Assert.NotSame (driver, Application.Driver);
Assert.NotSame (driver.InputProcessor, Application.Driver.InputProcessor);
Assert.True (driver.InputProcessor is FakeInputProcessor);
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
Assert.True (Application.Driver is DriverImpl);
Assert.True (Application.Driver.InputProcessor is WindowsInputProcessor);
}
else
{
Assert.True (Application.Driver is DriverImpl);
Assert.True (Application.Driver.InputProcessor is UnixInputProcessor);
}
Application.ResetState ();
}