/// <summary> /// <para>Initial method to start new User Story and BDD syntax.</para> /// <para>Uses test method name as the 'I Want' part of the User Story syntax.</para> /// <para>Follow this 'SoThat' with the 'As' to specify the 'As A' part of the User Story syntax.</para> /// </summary> /// <param name="businessValue">Supply an enumerator that describes the business values for the User Stories</param> /// <returns>Fluent interface providing BDD Given, When, Then syntax</returns> protected IBase SoThat(TBusinessValueEnum businessValue) { var loggerFactory = LoggerFactory ?? ConfigureDefaultLoggersFactory; var loggers = new Loggers(); loggers.AddRange(loggerFactory()); loggers.SetStartTextsToEmphasise("I want", "So that", "As", "Given", "When", "Then", "And"); return(Behaviour.SoThat(businessValue.ToString(), ApplicationLayer(), null, loggers)); }
/// <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); }