Main UBADDAS behaviour logic, providing fluent interface
Inheritance: IBase, IGiven, IWhen, IThen, IState, ISet
コード例 #1
0
ファイル: Behaviour.cs プロジェクト: KernowCode/UBADDAS
 /// <summary>
 /// New behaviour factory method
 /// </summary>
 /// <param name="businessValue">text describing the business value</param>
 /// <param name="targetApplicationLayer">project folder name containing target test class implementations</param>        
 /// <param name="appRunner">your page object model instance or other to operate the application</param>
 /// <param name="loggers">instance of loggers</param>
 /// <param name="preStepAction"> </param>
 /// <returns>new behaviour instance</returns>
 public static Behaviour SoThat(string businessValue, string targetApplicationLayer, object appRunner, Loggers loggers, Action preStepAction = null)
 {
     string testName = GetTestName();
     loggers.SetStartTextsToEmphasise("I want", "So that", "As", "Given", "When", "Then", "And");
     loggers.SetStartTextsToHaveSectionOpen("As");
     var behaviour = new Behaviour(targetApplicationLayer, appRunner, loggers, testName, businessValue, preStepAction);
     return behaviour;
 }
コード例 #2
0
        /// <summary>
        /// <para>Create a new test output file path based on test method name located at executing assembly TestOutput folder</para>
        /// <para>i.e. .../bin/Debug/kTestOutput/MyTest.html</para>
        /// </summary>
        /// <param name="extension">file extension to append to filename</param>
        /// <returns>filepath</returns>
        public static string GetTestOutputFilePath(string extension)
        {
            string timeStamp = DateTime.UtcNow.ToString("yyyyMMddHHmmssffff");

            return(Behaviour.GetTestFilename(@"{1}\kTestOutput\{0}.{2}.{3}", GetSourceDirectory(), timeStamp, extension));
        }