diff --git a/docs/api/CSF.Screenplay.IGetsScreenplay.html b/docs/api/CSF.Screenplay.IGetsScreenplay.html index f0c143e..a285203 100644 --- a/docs/api/CSF.Screenplay.IGetsScreenplay.html +++ b/docs/api/CSF.Screenplay.IGetsScreenplay.html @@ -89,7 +89,7 @@
Table of Contents

-Interface IGetsScreenplay +Interface IGetsScreenplay

@@ -123,8 +123,13 @@

Remarks

interface with a class of their own, in order to configure and get the Screenplay instance.

-Note that implementations of this type should have a public parameterless constructor, because they will not -be resolved from dependency injection. +Types which implement this interface need only implement the GetScreenplay() method, which should build +and return a Screenplay instance. In almost all cases, developers are advised to use ScreenplayBuilder +to build and return the Screenplay. +

+

+Note that implementations of this type must have a public parameterless constructor, because they will be instantiated +via CreateInstance(Type) and not resolved from dependency injection.

@@ -137,7 +142,7 @@

Methods

GetScreenplay() - +

Gets the configured Screenplay instance provided by the current type.

@@ -162,6 +167,16 @@

Returns

+

Remarks

+

+Implementors should create and return a new Screenplay instance from this method; they are strongly urged +to consider the use of ScreenplayBuilder for this purpose. +As well as the creation of the Screenplay instance itself, they should also add to the service collection any +services which relate to abilities which could be used in the Screenplay. +It is recommended to use ConfigureServices(Action<IServiceCollection>) +to accomplish this. +

+
@@ -170,7 +185,7 @@

Returns

- Edit this page + Edit this page
diff --git a/docs/api/CSF.Screenplay.ScreenplayAssemblyAttribute.html b/docs/api/CSF.Screenplay.ScreenplayAssemblyAttribute.html index 96e8625..d86d159 100644 --- a/docs/api/CSF.Screenplay.ScreenplayAssemblyAttribute.html +++ b/docs/api/CSF.Screenplay.ScreenplayAssemblyAttribute.html @@ -89,7 +89,7 @@
Table of Contents

-Class ScreenplayAssemblyAttribute +Class ScreenplayAssemblyAttribute

@@ -262,7 +262,7 @@

Examples

-Decorate your assembly with this attribute using the syntax [assembly: ScreenplayAssembly]. You may place this +Decorate your assembly with this attribute using the syntax [assembly: CSF.Screenplay.ScreenplayAssembly]. You may place this into any source file, outside of any type declaration. By convention it would be put into a dedicated source file within the Properties project directory.

@@ -274,8 +274,11 @@

Remarks

In order to run tests with Screenplay, the assembly must be decorated with this attribute.

-This attribute identifies a concrete implementation of IGetsScreenplay which will be used to build and retrieve -the Screenplay instance for running those tests. +This attribute has one mandatory parameter; that is the Type of a concrete implementation of +IGetsScreenplay. That type will be instantiated by the NUnit3 integration and will be used to +build and retrieve the Screenplay instance for running the Screenplay-based tests within the decorated +assembly. Each test method must additionally be decorated with the ScreenplayAttribute in order to make +it a Screenplay-based test.

@@ -288,7 +291,7 @@

Constructors

ScreenplayAssemblyAttribute(Type) - +

Initializes a new instance of ScreenplayAssemblyAttribute.

@@ -331,7 +334,7 @@

Properties

Targets - +

Provides the target for the action attribute

@@ -367,7 +370,7 @@

Methods

AfterTest(ITest) - +

Executed after each test is run

@@ -400,7 +403,7 @@

Parameters

BeforeTest(ITest) - +

Executed before each test is run

@@ -433,7 +436,7 @@

Parameters

GetScreenplay() - +

Gets the Screenplay which is to be used for tests contained in the current assembly.

@@ -469,11 +472,15 @@

Exceptions

+

See Also

+ diff --git a/docs/api/CSF.Screenplay.ScreenplayAttribute.html b/docs/api/CSF.Screenplay.ScreenplayAttribute.html index a665caf..1cb9a45 100644 --- a/docs/api/CSF.Screenplay.ScreenplayAttribute.html +++ b/docs/api/CSF.Screenplay.ScreenplayAttribute.html @@ -89,7 +89,7 @@
Table of Contents

-Class ScreenplayAttribute +Class ScreenplayAttribute

@@ -285,7 +285,7 @@

Properties

Targets - +

Gets the targets for the attribute (when performing before/after test actions).

@@ -322,7 +322,7 @@

Methods

AfterTest(ITest) - +

Executed after each test is run

@@ -355,7 +355,7 @@

Parameters

BeforeTest(ITest) - +

Executed before each test is run

@@ -388,7 +388,7 @@

Parameters

BuildFrom(IMethodInfo, Test) - +

Build one or more TestMethods from the provided MethodInfo.

@@ -426,11 +426,15 @@

Returns

+

See Also

+ diff --git a/docs/api/CSF.Screenplay.ScreenplayBuilder.html b/docs/api/CSF.Screenplay.ScreenplayBuilder.html index 8178718..0f324b0 100644 --- a/docs/api/CSF.Screenplay.ScreenplayBuilder.html +++ b/docs/api/CSF.Screenplay.ScreenplayBuilder.html @@ -175,7 +175,7 @@

Constructors

ScreenplayBuilder(IServiceCollection) - +

Initialises a new instance of the ScreenplayBuilder.

@@ -267,6 +267,61 @@

Exceptions

+ + +

+ ConfigureServices(Action<IServiceCollection>) + +

+ +

Configures further services into the IServiceCollection which is contained within the current builder.

+
+
+ +
+
public ScreenplayBuilder ConfigureServices(Action<IServiceCollection> configurationAction)
+
+ +

Parameters

+
+
configurationAction Action<IServiceCollection>
+

Logic which may be used to perform further configuration upon the service collection.

+
+
+ +

Returns

+
+
ScreenplayBuilder
+

The same builder instance, so that calls may be chained.

+
+
+ + + + + + + +

Remarks

+

+Use this method to add service descriptors to the service collection for services which are not directly part of the Screenplay +architecture, but which you wish to access from Screenplay. +Most often these will be types and services which will be used as (or by) Screenplay abilities. +

+

+Abilities added to dependency injection in this way may be constructor-injected into IPersona implementations. +

+
+ +

Exceptions

+
+
ArgumentNullException
+

If configurationAction is null.

+
+
+ + +

diff --git a/docs/docs/nUnitTutorial/index.html b/docs/docs/nUnitTutorial/index.html index d86f625..b418e0c 100644 --- a/docs/docs/nUnitTutorial/index.html +++ b/docs/docs/nUnitTutorial/index.html @@ -87,11 +87,19 @@

Table of Contents

Screenplay & NUnit tutorial

-

Begin using Screenplay with NUnit tests with these steps.

+

Begin writing NUnit tests using Screenplay by following these steps. +Further detail is provided below.

  1. Ensure that your test project uses NUnit version 3.6.0 or higher
  2. -
  3. Install the package CSF.Screenplay.NUnit to your test project
  4. +
  5. Install the NuGet package CSF.Screenplay.NUnit to your test project
  6. +
  7. Write a class which implements IGetsScreenplay
  8. +
  9. Decorate your test assembly with ScreenplayAssemblyAttribute, referencing your implementation of IGetsScreenplay
  10. +
  11. Write your tests, decorating each test method with ScreenplayAttribute
  12. +
  13. Add parameters to your test methods to access the Screenplay architecture
+

Decorating your test assembly with [ScreenplayAssembly]

+

TODO: Write this docco

+

Writing test methods

TODO: Write this docco

diff --git a/docs/index.json b/docs/index.json index 68b594e..8d36eb4 100644 --- a/docs/index.json +++ b/docs/index.json @@ -112,7 +112,7 @@ "api/CSF.Screenplay.IGetsScreenplay.html": { "href": "api/CSF.Screenplay.IGetsScreenplay.html", "title": "Interface IGetsScreenplay | Screenplay docs", - "keywords": "Interface IGetsScreenplay Namespace CSF.Screenplay Assembly CSF.Screenplay.dll An object which can fully configure and get a Screenplay instance. public interface IGetsScreenplay Remarks This interface is particularly important when using Screenplay as a testing tool. Some test integrations do not have any inherent extension points for the placement of 'configuration' or startup logic which affects the entire test run. In those cases, a developer will need to implement this interface with a class of their own, in order to configure and get the Screenplay instance. Note that implementations of this type should have a public parameterless constructor, because they will not be resolved from dependency injection. Methods GetScreenplay() Gets the configured Screenplay instance provided by the current type. Screenplay GetScreenplay() Returns Screenplay A Screenplay instance" + "keywords": "Interface IGetsScreenplay Namespace CSF.Screenplay Assembly CSF.Screenplay.dll An object which can fully configure and get a Screenplay instance. public interface IGetsScreenplay Remarks This interface is particularly important when using Screenplay as a testing tool. Some test integrations do not have any inherent extension points for the placement of 'configuration' or startup logic which affects the entire test run. In those cases, a developer will need to implement this interface with a class of their own, in order to configure and get the Screenplay instance. Types which implement this interface need only implement the GetScreenplay() method, which should build and return a Screenplay instance. In almost all cases, developers are advised to use ScreenplayBuilder to build and return the Screenplay. Note that implementations of this type must have a public parameterless constructor, because they will be instantiated via CreateInstance(Type) and not resolved from dependency injection. Methods GetScreenplay() Gets the configured Screenplay instance provided by the current type. Screenplay GetScreenplay() Returns Screenplay A Screenplay instance Remarks Implementors should create and return a new Screenplay instance from this method; they are strongly urged to consider the use of ScreenplayBuilder for this purpose. As well as the creation of the Screenplay instance itself, they should also add to the service collection any services which relate to abilities which could be used in the Screenplay. It is recommended to use ConfigureServices(Action) to accomplish this." }, "api/CSF.Screenplay.IHasAbilities.html": { "href": "api/CSF.Screenplay.IHasAbilities.html", @@ -317,17 +317,17 @@ "api/CSF.Screenplay.ScreenplayAssemblyAttribute.html": { "href": "api/CSF.Screenplay.ScreenplayAssemblyAttribute.html", "title": "Class ScreenplayAssemblyAttribute | Screenplay docs", - "keywords": "Class ScreenplayAssemblyAttribute Namespace CSF.Screenplay Assembly CSF.Screenplay.NUnit.dll An attribute used to mark an assembly which contains Screenplay-based tests. [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)] public class ScreenplayAssemblyAttribute : TestActionAttribute, ITestAction Inheritance object Attribute TestActionAttribute ScreenplayAssemblyAttribute Implements ITestAction Inherited Members Attribute.Equals(object) Attribute.GetCustomAttribute(Assembly, Type) Attribute.GetCustomAttribute(Assembly, Type, bool) Attribute.GetCustomAttribute(MemberInfo, Type) Attribute.GetCustomAttribute(MemberInfo, Type, bool) Attribute.GetCustomAttribute(Module, Type) Attribute.GetCustomAttribute(Module, Type, bool) Attribute.GetCustomAttribute(ParameterInfo, Type) Attribute.GetCustomAttribute(ParameterInfo, Type, bool) Attribute.GetCustomAttributes(Assembly) Attribute.GetCustomAttributes(Assembly, bool) Attribute.GetCustomAttributes(Assembly, Type) Attribute.GetCustomAttributes(Assembly, Type, bool) Attribute.GetCustomAttributes(MemberInfo) Attribute.GetCustomAttributes(MemberInfo, bool) Attribute.GetCustomAttributes(MemberInfo, Type) Attribute.GetCustomAttributes(MemberInfo, Type, bool) Attribute.GetCustomAttributes(Module) Attribute.GetCustomAttributes(Module, bool) Attribute.GetCustomAttributes(Module, Type) Attribute.GetCustomAttributes(Module, Type, bool) Attribute.GetCustomAttributes(ParameterInfo) Attribute.GetCustomAttributes(ParameterInfo, bool) Attribute.GetCustomAttributes(ParameterInfo, Type) Attribute.GetCustomAttributes(ParameterInfo, Type, bool) Attribute.GetHashCode() Attribute.IsDefaultAttribute() Attribute.IsDefined(Assembly, Type) Attribute.IsDefined(Assembly, Type, bool) Attribute.IsDefined(MemberInfo, Type) Attribute.IsDefined(MemberInfo, Type, bool) Attribute.IsDefined(Module, Type) Attribute.IsDefined(Module, Type, bool) Attribute.IsDefined(ParameterInfo, Type) Attribute.IsDefined(ParameterInfo, Type, bool) Attribute.Match(object) Attribute.TypeId object.Equals(object, object) object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Examples Decorate your assembly with this attribute using the syntax [assembly: ScreenplayAssembly]. You may place this into any source file, outside of any type declaration. By convention it would be put into a dedicated source file within the Properties project directory. Remarks This attribute is the core of the NUnit3 test framework integration with Screenplay. In order to run tests with Screenplay, the assembly must be decorated with this attribute. This attribute identifies a concrete implementation of IGetsScreenplay which will be used to build and retrieve the Screenplay instance for running those tests. Constructors ScreenplayAssemblyAttribute(Type) Initializes a new instance of ScreenplayAssemblyAttribute. public ScreenplayAssemblyAttribute(Type factoryType) Parameters factoryType Type The concrete type of a class which implements IGetsScreenplay. Remarks The factoryType specified in this constructor must meet all of the following criteria: It must be a non-nullType which derives from IGetsScreenplay It must have a public parameterless constructor It must return a non-null instance of Screenplay from its GetScreenplay() method Properties Targets Provides the target for the action attribute public override ActionTargets Targets { get; } Property Value ActionTargets Methods AfterTest(ITest) Executed after each test is run public override void AfterTest(ITest test) Parameters test ITest The test that has just been run. BeforeTest(ITest) Executed before each test is run public override void BeforeTest(ITest test) Parameters test ITest The test that is going to be run. GetScreenplay() Gets the Screenplay which is to be used for tests contained in the current assembly. public Screenplay GetScreenplay() Returns Screenplay The Screenplay. Exceptions InvalidOperationException If the Screenplay factory used with the constructor to this attribute is invalid or fails to return a non-nullScreenplay instance." + "keywords": "Class ScreenplayAssemblyAttribute Namespace CSF.Screenplay Assembly CSF.Screenplay.NUnit.dll An attribute used to mark an assembly which contains Screenplay-based tests. [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)] public class ScreenplayAssemblyAttribute : TestActionAttribute, ITestAction Inheritance object Attribute TestActionAttribute ScreenplayAssemblyAttribute Implements ITestAction Inherited Members Attribute.Equals(object) Attribute.GetCustomAttribute(Assembly, Type) Attribute.GetCustomAttribute(Assembly, Type, bool) Attribute.GetCustomAttribute(MemberInfo, Type) Attribute.GetCustomAttribute(MemberInfo, Type, bool) Attribute.GetCustomAttribute(Module, Type) Attribute.GetCustomAttribute(Module, Type, bool) Attribute.GetCustomAttribute(ParameterInfo, Type) Attribute.GetCustomAttribute(ParameterInfo, Type, bool) Attribute.GetCustomAttributes(Assembly) Attribute.GetCustomAttributes(Assembly, bool) Attribute.GetCustomAttributes(Assembly, Type) Attribute.GetCustomAttributes(Assembly, Type, bool) Attribute.GetCustomAttributes(MemberInfo) Attribute.GetCustomAttributes(MemberInfo, bool) Attribute.GetCustomAttributes(MemberInfo, Type) Attribute.GetCustomAttributes(MemberInfo, Type, bool) Attribute.GetCustomAttributes(Module) Attribute.GetCustomAttributes(Module, bool) Attribute.GetCustomAttributes(Module, Type) Attribute.GetCustomAttributes(Module, Type, bool) Attribute.GetCustomAttributes(ParameterInfo) Attribute.GetCustomAttributes(ParameterInfo, bool) Attribute.GetCustomAttributes(ParameterInfo, Type) Attribute.GetCustomAttributes(ParameterInfo, Type, bool) Attribute.GetHashCode() Attribute.IsDefaultAttribute() Attribute.IsDefined(Assembly, Type) Attribute.IsDefined(Assembly, Type, bool) Attribute.IsDefined(MemberInfo, Type) Attribute.IsDefined(MemberInfo, Type, bool) Attribute.IsDefined(Module, Type) Attribute.IsDefined(Module, Type, bool) Attribute.IsDefined(ParameterInfo, Type) Attribute.IsDefined(ParameterInfo, Type, bool) Attribute.Match(object) Attribute.TypeId object.Equals(object, object) object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Examples Decorate your assembly with this attribute using the syntax [assembly: CSF.Screenplay.ScreenplayAssembly]. You may place this into any source file, outside of any type declaration. By convention it would be put into a dedicated source file within the Properties project directory. Remarks This attribute is the core of the NUnit3 test framework integration with Screenplay. In order to run tests with Screenplay, the assembly must be decorated with this attribute. This attribute has one mandatory parameter; that is the Type of a concrete implementation of IGetsScreenplay. That type will be instantiated by the NUnit3 integration and will be used to build and retrieve the Screenplay instance for running the Screenplay-based tests within the decorated assembly. Each test method must additionally be decorated with the ScreenplayAttribute in order to make it a Screenplay-based test. Constructors ScreenplayAssemblyAttribute(Type) Initializes a new instance of ScreenplayAssemblyAttribute. public ScreenplayAssemblyAttribute(Type factoryType) Parameters factoryType Type The concrete type of a class which implements IGetsScreenplay. Remarks The factoryType specified in this constructor must meet all of the following criteria: It must be a non-nullType which derives from IGetsScreenplay It must have a public parameterless constructor It must return a non-null instance of Screenplay from its GetScreenplay() method Properties Targets Provides the target for the action attribute public override ActionTargets Targets { get; } Property Value ActionTargets Methods AfterTest(ITest) Executed after each test is run public override void AfterTest(ITest test) Parameters test ITest The test that has just been run. BeforeTest(ITest) Executed before each test is run public override void BeforeTest(ITest test) Parameters test ITest The test that is going to be run. GetScreenplay() Gets the Screenplay which is to be used for tests contained in the current assembly. public Screenplay GetScreenplay() Returns Screenplay The Screenplay. Exceptions InvalidOperationException If the Screenplay factory used with the constructor to this attribute is invalid or fails to return a non-nullScreenplay instance. See Also ScreenplayAttribute" }, "api/CSF.Screenplay.ScreenplayAttribute.html": { "href": "api/CSF.Screenplay.ScreenplayAttribute.html", "title": "Class ScreenplayAttribute | Screenplay docs", - "keywords": "Class ScreenplayAttribute Namespace CSF.Screenplay Assembly CSF.Screenplay.NUnit.dll Applied to a test method, indicates that decorated test is a Screenplay test. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public class ScreenplayAttribute : Attribute, ITestAction, ITestBuilder Inheritance object Attribute ScreenplayAttribute Implements ITestAction ITestBuilder Inherited Members Attribute.Equals(object) Attribute.GetCustomAttribute(Assembly, Type) Attribute.GetCustomAttribute(Assembly, Type, bool) Attribute.GetCustomAttribute(MemberInfo, Type) Attribute.GetCustomAttribute(MemberInfo, Type, bool) Attribute.GetCustomAttribute(Module, Type) Attribute.GetCustomAttribute(Module, Type, bool) Attribute.GetCustomAttribute(ParameterInfo, Type) Attribute.GetCustomAttribute(ParameterInfo, Type, bool) Attribute.GetCustomAttributes(Assembly) Attribute.GetCustomAttributes(Assembly, bool) Attribute.GetCustomAttributes(Assembly, Type) Attribute.GetCustomAttributes(Assembly, Type, bool) Attribute.GetCustomAttributes(MemberInfo) Attribute.GetCustomAttributes(MemberInfo, bool) Attribute.GetCustomAttributes(MemberInfo, Type) Attribute.GetCustomAttributes(MemberInfo, Type, bool) Attribute.GetCustomAttributes(Module) Attribute.GetCustomAttributes(Module, bool) Attribute.GetCustomAttributes(Module, Type) Attribute.GetCustomAttributes(Module, Type, bool) Attribute.GetCustomAttributes(ParameterInfo) Attribute.GetCustomAttributes(ParameterInfo, bool) Attribute.GetCustomAttributes(ParameterInfo, Type) Attribute.GetCustomAttributes(ParameterInfo, Type, bool) Attribute.GetHashCode() Attribute.IsDefaultAttribute() Attribute.IsDefined(Assembly, Type) Attribute.IsDefined(Assembly, Type, bool) Attribute.IsDefined(MemberInfo, Type) Attribute.IsDefined(MemberInfo, Type, bool) Attribute.IsDefined(Module, Type) Attribute.IsDefined(Module, Type, bool) Attribute.IsDefined(ParameterInfo, Type) Attribute.IsDefined(ParameterInfo, Type, bool) Attribute.Match(object) Attribute.TypeId object.Equals(object, object) object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Remarks When a test method is decorated with this attribute then the test corresponding to that method will be executed via Screenplay. This means that the affected test method will be executed as an IPerformance. It also means that all parameters for the method will be provided by resolving them from the current performance's ServiceProvider. See the article on dependency injection in Screenplay for more information about what may be injected into test logic from DI, via the test method parameters. Remember that for this attribute to be effective, the Assembly which contains the test method must be decorated with ScreenplayAssemblyAttribute. If it is not, then the test will fail with an exception. Properties Targets Gets the targets for the attribute (when performing before/after test actions). public ActionTargets Targets { get; } Property Value ActionTargets The targets. Methods AfterTest(ITest) Executed after each test is run public void AfterTest(ITest test) Parameters test ITest The test that has just been run. BeforeTest(ITest) Executed before each test is run public void BeforeTest(ITest test) Parameters test ITest The test that is going to be run. BuildFrom(IMethodInfo, Test) Build one or more TestMethods from the provided MethodInfo. public IEnumerable BuildFrom(IMethodInfo method, Test suite) Parameters method IMethodInfo The method to be used as a test suite Test The TestSuite to which the method will be added Returns IEnumerable A TestMethod object" + "keywords": "Class ScreenplayAttribute Namespace CSF.Screenplay Assembly CSF.Screenplay.NUnit.dll Applied to a test method, indicates that decorated test is a Screenplay test. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public class ScreenplayAttribute : Attribute, ITestAction, ITestBuilder Inheritance object Attribute ScreenplayAttribute Implements ITestAction ITestBuilder Inherited Members Attribute.Equals(object) Attribute.GetCustomAttribute(Assembly, Type) Attribute.GetCustomAttribute(Assembly, Type, bool) Attribute.GetCustomAttribute(MemberInfo, Type) Attribute.GetCustomAttribute(MemberInfo, Type, bool) Attribute.GetCustomAttribute(Module, Type) Attribute.GetCustomAttribute(Module, Type, bool) Attribute.GetCustomAttribute(ParameterInfo, Type) Attribute.GetCustomAttribute(ParameterInfo, Type, bool) Attribute.GetCustomAttributes(Assembly) Attribute.GetCustomAttributes(Assembly, bool) Attribute.GetCustomAttributes(Assembly, Type) Attribute.GetCustomAttributes(Assembly, Type, bool) Attribute.GetCustomAttributes(MemberInfo) Attribute.GetCustomAttributes(MemberInfo, bool) Attribute.GetCustomAttributes(MemberInfo, Type) Attribute.GetCustomAttributes(MemberInfo, Type, bool) Attribute.GetCustomAttributes(Module) Attribute.GetCustomAttributes(Module, bool) Attribute.GetCustomAttributes(Module, Type) Attribute.GetCustomAttributes(Module, Type, bool) Attribute.GetCustomAttributes(ParameterInfo) Attribute.GetCustomAttributes(ParameterInfo, bool) Attribute.GetCustomAttributes(ParameterInfo, Type) Attribute.GetCustomAttributes(ParameterInfo, Type, bool) Attribute.GetHashCode() Attribute.IsDefaultAttribute() Attribute.IsDefined(Assembly, Type) Attribute.IsDefined(Assembly, Type, bool) Attribute.IsDefined(MemberInfo, Type) Attribute.IsDefined(MemberInfo, Type, bool) Attribute.IsDefined(Module, Type) Attribute.IsDefined(Module, Type, bool) Attribute.IsDefined(ParameterInfo, Type) Attribute.IsDefined(ParameterInfo, Type, bool) Attribute.Match(object) Attribute.TypeId object.Equals(object, object) object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Remarks When a test method is decorated with this attribute then the test corresponding to that method will be executed via Screenplay. This means that the affected test method will be executed as an IPerformance. It also means that all parameters for the method will be provided by resolving them from the current performance's ServiceProvider. See the article on dependency injection in Screenplay for more information about what may be injected into test logic from DI, via the test method parameters. Remember that for this attribute to be effective, the Assembly which contains the test method must be decorated with ScreenplayAssemblyAttribute. If it is not, then the test will fail with an exception. Properties Targets Gets the targets for the attribute (when performing before/after test actions). public ActionTargets Targets { get; } Property Value ActionTargets The targets. Methods AfterTest(ITest) Executed after each test is run public void AfterTest(ITest test) Parameters test ITest The test that has just been run. BeforeTest(ITest) Executed before each test is run public void BeforeTest(ITest test) Parameters test ITest The test that is going to be run. BuildFrom(IMethodInfo, Test) Build one or more TestMethods from the provided MethodInfo. public IEnumerable BuildFrom(IMethodInfo method, Test suite) Parameters method IMethodInfo The method to be used as a test suite Test The TestSuite to which the method will be added Returns IEnumerable A TestMethod object See Also ScreenplayAssemblyAttribute" }, "api/CSF.Screenplay.ScreenplayBuilder.html": { "href": "api/CSF.Screenplay.ScreenplayBuilder.html", "title": "Class ScreenplayBuilder | Screenplay docs", - "keywords": "Class ScreenplayBuilder Namespace CSF.Screenplay Assembly CSF.Screenplay.dll A type which may be used to configure an instance of Screenplay prior to creating it. public class ScreenplayBuilder Inheritance object ScreenplayBuilder Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Remarks The Screenplay type is immutable once created, so this builder type permits configuring the Screenplay before its actual creation. The majority of configuration of the Screenplay is performed via Dependency Injection. The constructor for this builder type accepts an IServiceCollection as a parameter. If you explicitly specify a service collection in the constructor then you may pass an instance which has service descriptors already added. These descriptors would typically be for types which assist in the resolution of Abilitity types and IPersona types. In advanced usages, you might wish to add custom implementations of the following types to the service collection: The ICast The IStage The performance factory: ICreatesPerformance For more information, see the Dependency Injection article. Constructors ScreenplayBuilder(IServiceCollection) Initialises a new instance of the ScreenplayBuilder. public ScreenplayBuilder(IServiceCollection services = null) Parameters services IServiceCollection An optional service collection Remarks If you specify a non-null service collection then you may use a service collection which contains your own dependency injection service descriptors. If you omit this parameter or specify null then a new/empty service collection will be used as the basis for the Screenplay. Methods BuildScreenplay() Builds and returns the Screenplay instance, and finalises the service collection associated with the current instance. public Screenplay BuildScreenplay() Returns Screenplay A Screenplay instance Remarks This method will not only build and return the Screenplay instance, it will also finalise the service collection, by executing BuildServiceProvider(IServiceCollection) upon it. If you wish to add further services to the service collection, to be used by the Screenplay, then you must do so before using this method. Also take note that instances of ScreenplayBuilder are not reusable. Calling this method a second time from the same builder instance will raise an exception. Exceptions InvalidOperationException If this method has already been used WithCast(Func) Configures this builder to build a Screenplay with a custom implementation of ICast. public ScreenplayBuilder WithCast(Func factory) Parameters factory Func A factory function for the creation of a cast. Returns ScreenplayBuilder The same builder instance, so that calls may be chained. WithCast() Configures this builder to build a Screenplay with a custom implementation of ICast. public ScreenplayBuilder WithCast() where TCast : class, ICast Returns ScreenplayBuilder The same builder instance, so that calls may be chained. Type Parameters TCast The concrete type of ICast to use. WithPerformanceFactory(Func) Configures this builder to build a Screenplay with a custom implementation of ICreatesPerformance. public ScreenplayBuilder WithPerformanceFactory(Func factory) Parameters factory Func A factory function for the creation of a performance factory. Returns ScreenplayBuilder The same builder instance, so that calls may be chained. WithPerformanceFactory() Configures this builder to build a Screenplay with a custom implementation of ICreatesPerformance. public ScreenplayBuilder WithPerformanceFactory() where TPerformanceFactory : class, ICreatesPerformance Returns ScreenplayBuilder The same builder instance, so that calls may be chained. Type Parameters TPerformanceFactory The concrete type of ICreatesPerformance to use. WithStage(Func) Configures this builder to build a Screenplay with a custom implementation of IStage. public ScreenplayBuilder WithStage(Func factory) Parameters factory Func A factory function for the creation of a stage. Returns ScreenplayBuilder The same builder instance, so that calls may be chained. WithStage() Configures this builder to build a Screenplay with a custom implementation of IStage. public ScreenplayBuilder WithStage() where TStage : class, IStage Returns ScreenplayBuilder The same builder instance, so that calls may be chained. Type Parameters TStage The concrete type of IStage to use. See Also Screenplay IServiceCollection IPersona ICast IStage ICreatesPerformance BuildScreenplay()" + "keywords": "Class ScreenplayBuilder Namespace CSF.Screenplay Assembly CSF.Screenplay.dll A type which may be used to configure an instance of Screenplay prior to creating it. public class ScreenplayBuilder Inheritance object ScreenplayBuilder Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Remarks The Screenplay type is immutable once created, so this builder type permits configuring the Screenplay before its actual creation. The majority of configuration of the Screenplay is performed via Dependency Injection. The constructor for this builder type accepts an IServiceCollection as a parameter. If you explicitly specify a service collection in the constructor then you may pass an instance which has service descriptors already added. These descriptors would typically be for types which assist in the resolution of Abilitity types and IPersona types. In advanced usages, you might wish to add custom implementations of the following types to the service collection: The ICast The IStage The performance factory: ICreatesPerformance For more information, see the Dependency Injection article. Constructors ScreenplayBuilder(IServiceCollection) Initialises a new instance of the ScreenplayBuilder. public ScreenplayBuilder(IServiceCollection services = null) Parameters services IServiceCollection An optional service collection Remarks If you specify a non-null service collection then you may use a service collection which contains your own dependency injection service descriptors. If you omit this parameter or specify null then a new/empty service collection will be used as the basis for the Screenplay. Methods BuildScreenplay() Builds and returns the Screenplay instance, and finalises the service collection associated with the current instance. public Screenplay BuildScreenplay() Returns Screenplay A Screenplay instance Remarks This method will not only build and return the Screenplay instance, it will also finalise the service collection, by executing BuildServiceProvider(IServiceCollection) upon it. If you wish to add further services to the service collection, to be used by the Screenplay, then you must do so before using this method. Also take note that instances of ScreenplayBuilder are not reusable. Calling this method a second time from the same builder instance will raise an exception. Exceptions InvalidOperationException If this method has already been used ConfigureServices(Action) Configures further services into the IServiceCollection which is contained within the current builder. public ScreenplayBuilder ConfigureServices(Action configurationAction) Parameters configurationAction Action Logic which may be used to perform further configuration upon the service collection. Returns ScreenplayBuilder The same builder instance, so that calls may be chained. Remarks Use this method to add service descriptors to the service collection for services which are not directly part of the Screenplay architecture, but which you wish to access from Screenplay. Most often these will be types and services which will be used as (or by) Screenplay abilities. Abilities added to dependency injection in this way may be constructor-injected into IPersona implementations. Exceptions ArgumentNullException If configurationAction is null. WithCast(Func) Configures this builder to build a Screenplay with a custom implementation of ICast. public ScreenplayBuilder WithCast(Func factory) Parameters factory Func A factory function for the creation of a cast. Returns ScreenplayBuilder The same builder instance, so that calls may be chained. WithCast() Configures this builder to build a Screenplay with a custom implementation of ICast. public ScreenplayBuilder WithCast() where TCast : class, ICast Returns ScreenplayBuilder The same builder instance, so that calls may be chained. Type Parameters TCast The concrete type of ICast to use. WithPerformanceFactory(Func) Configures this builder to build a Screenplay with a custom implementation of ICreatesPerformance. public ScreenplayBuilder WithPerformanceFactory(Func factory) Parameters factory Func A factory function for the creation of a performance factory. Returns ScreenplayBuilder The same builder instance, so that calls may be chained. WithPerformanceFactory() Configures this builder to build a Screenplay with a custom implementation of ICreatesPerformance. public ScreenplayBuilder WithPerformanceFactory() where TPerformanceFactory : class, ICreatesPerformance Returns ScreenplayBuilder The same builder instance, so that calls may be chained. Type Parameters TPerformanceFactory The concrete type of ICreatesPerformance to use. WithStage(Func) Configures this builder to build a Screenplay with a custom implementation of IStage. public ScreenplayBuilder WithStage(Func factory) Parameters factory Func A factory function for the creation of a stage. Returns ScreenplayBuilder The same builder instance, so that calls may be chained. WithStage() Configures this builder to build a Screenplay with a custom implementation of IStage. public ScreenplayBuilder WithStage() where TStage : class, IStage Returns ScreenplayBuilder The same builder instance, so that calls may be chained. Type Parameters TStage The concrete type of IStage to use. See Also Screenplay IServiceCollection IPersona ICast IStage ICreatesPerformance BuildScreenplay()" }, "api/CSF.Screenplay.ScreenplayExtensions.html": { "href": "api/CSF.Screenplay.ScreenplayExtensions.html", @@ -407,7 +407,7 @@ "docs/nUnitTutorial/index.html": { "href": "docs/nUnitTutorial/index.html", "title": "Screenplay & NUnit tutorial | Screenplay docs", - "keywords": "Screenplay & NUnit tutorial Begin using Screenplay with NUnit tests with these steps. Ensure that your test project uses NUnit version 3.6.0 or higher Install the package CSF.Screenplay.NUnit to your test project TODO: Write this docco" + "keywords": "Screenplay & NUnit tutorial Begin writing NUnit tests using Screenplay by following these steps. Further detail is provided below. Ensure that your test project uses NUnit version 3.6.0 or higher Install the NuGet package CSF.Screenplay.NUnit to your test project Write a class which implements IGetsScreenplay Decorate your test assembly with ScreenplayAssemblyAttribute, referencing your implementation of IGetsScreenplay Write your tests, decorating each test method with ScreenplayAttribute Add parameters to your test methods to access the Screenplay architecture Decorating your test assembly with [ScreenplayAssembly] TODO: Write this docco Writing test methods TODO: Write this docco" }, "docs/performables/index.html": { "href": "docs/performables/index.html", diff --git a/docs/xrefmap.yml b/docs/xrefmap.yml index 9d12a26..2ff155a 100644 --- a/docs/xrefmap.yml +++ b/docs/xrefmap.yml @@ -3321,6 +3321,22 @@ references: isSpec: "True" fullName: CSF.Screenplay.ScreenplayBuilder.BuildScreenplay nameWithType: ScreenplayBuilder.BuildScreenplay +- uid: CSF.Screenplay.ScreenplayBuilder.ConfigureServices(System.Action{Microsoft.Extensions.DependencyInjection.IServiceCollection}) + name: ConfigureServices(Action) + href: api/CSF.Screenplay.ScreenplayBuilder.html#CSF_Screenplay_ScreenplayBuilder_ConfigureServices_System_Action_Microsoft_Extensions_DependencyInjection_IServiceCollection__ + commentId: M:CSF.Screenplay.ScreenplayBuilder.ConfigureServices(System.Action{Microsoft.Extensions.DependencyInjection.IServiceCollection}) + name.vb: ConfigureServices(Action(Of IServiceCollection)) + fullName: CSF.Screenplay.ScreenplayBuilder.ConfigureServices(System.Action) + fullName.vb: CSF.Screenplay.ScreenplayBuilder.ConfigureServices(System.Action(Of Microsoft.Extensions.DependencyInjection.IServiceCollection)) + nameWithType: ScreenplayBuilder.ConfigureServices(Action) + nameWithType.vb: ScreenplayBuilder.ConfigureServices(Action(Of IServiceCollection)) +- uid: CSF.Screenplay.ScreenplayBuilder.ConfigureServices* + name: ConfigureServices + href: api/CSF.Screenplay.ScreenplayBuilder.html#CSF_Screenplay_ScreenplayBuilder_ConfigureServices_ + commentId: Overload:CSF.Screenplay.ScreenplayBuilder.ConfigureServices + isSpec: "True" + fullName: CSF.Screenplay.ScreenplayBuilder.ConfigureServices + nameWithType: ScreenplayBuilder.ConfigureServices - uid: CSF.Screenplay.ScreenplayBuilder.WithCast(System.Func{System.IServiceProvider,CSF.Screenplay.ICast}) name: WithCast(Func) href: api/CSF.Screenplay.ScreenplayBuilder.html#CSF_Screenplay_ScreenplayBuilder_WithCast_System_Func_System_IServiceProvider_CSF_Screenplay_ICast__