| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
-
- namespace TerminalGuiFluentTesting;
- /// <summary>
- /// Entry point to fluent assertions.
- /// </summary>
- public static class With
- {
- /// <summary>
- /// Entrypoint to fluent assertions
- /// </summary>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <param name="testDriver">Which v2 testDriver to use for the test</param>
- /// <param name="logWriter"></param>
- /// <returns></returns>
- public static GuiTestContext A<T> (int width, int height, TestDriver testDriver, TextWriter? logWriter = null) where T : IRunnable, new()
- {
- return new (() => new T ()
- {
- //Id = $"{typeof (T).Name}"
- }, width, height, testDriver, logWriter, Timeout);
- }
- /// <summary>
- /// Overload that takes a function to create instance <paramref name="runnableFactory"/> after application is initialized.
- /// </summary>
- /// <param name="runnableFactory"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <param name="testDriver"></param>
- /// <param name="logWriter"></param>
- /// <returns></returns>
- public static GuiTestContext A (Func<IRunnable> runnableFactory, int width, int height, TestDriver testDriver, TextWriter? logWriter = null)
- {
- return new (runnableFactory, width, height, testDriver, logWriter, Timeout);
- }
- /// <summary>
- /// The global timeout to allow for any given application to run for before shutting down.
- /// </summary>
- public static TimeSpan Timeout { get; set; } = TimeSpan.FromSeconds (30);
- }
|