You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allows you to create a project, using any template available with `dotnet new`, and it associated xunit test project.
9
+
=======
10
+
Allows you to create a project of any type (possible with `dotnet new`) and its associated test project (using `xunit`).
11
+
Optionally, you can also create a functional tests project which automatically import `Microsoft.AspNetCore.App` and `Microsoft.AspNetCore.Mvc.Testing`.
|`-projectName`|`-p`| No | Yes || The name of the project that you want to create, for exmaple: `SomeCoolProject`. |
74
-
|`-projectTemplate`|`-t`| No | No |`web`| The `dotnet new` template to use for the main project. |
75
-
|`-createSolution`|`-create-sln`| Yes | No |`$false`| Specify if you want to create a solution. |
76
-
|`-solutionName`|`-s`| No | No || The name of the solution to create if it differs from the project name. You must include the `.sln` extension; example: `My.sln`. |
77
-
|`-mkdir`|| No | No |`$true`| Specify if you want to make a new directoy for the solution. |
78
-
|`-noBuild`|`-no-build`| Yes | No || If specified, `dotnet build` will not be run after the projects creation. |
80
+
#### Parameters
79
81
80
-
### How to use
82
+
| Parameter | Alias | Switch? | Required | Version | Default Value | Description |
|`-projectName`|`-p`| No | Yes | 1.0.0 || The name of the project that you want to create, for exmaple: `SomeCoolProject`. |
85
+
|`-projectTemplate`|`-t`| No | No | 1.0.0 |`web`| The `dotnet new` template to use for the main project. |
86
+
|`-createSolution`|`-create-sln`| Yes | No | 1.0.0 |`$false`| Specify if you want to create a solution. |
87
+
|`-solutionName`|`-s`| No | No | 1.0.0 || The name of the solution to create if it differs from the project name. |
88
+
|`-mkdir`|| No | No | 1.0.0 |`$true`| Specify if you want to make a new directoy for the solution. |
89
+
|`-noBuild`|`-no-build`| Yes | No | 1.0.0 || If specified, `dotnet build` will not run after the projects creation. |
90
+
|`-addFunctionalTests`|`-add-functional-tests`| Yes | No | 1.1.0 || If specified, `Add-FunctionalTests` will be called to add a function tests project. |
91
+
|`-customTestsPropsFile`|`-tests-props`| No | No | 1.1.0 |`$null`| Allow specifying a `.props` file that will be imported at the top of the unit test project. |
92
+
|`-customFunctionalTestsPropsFile`|`-functional-tests-props`| No | No | 1.1.0 |`$null`| Allow specifying a `.props` file that will be imported at the top of the functional test project. |
93
+
94
+
#### How to use
81
95
82
96
How to create a project and a test project (named `SomeCoolProject`) in an existing solution:
83
97
@@ -115,8 +129,72 @@ To tell the script not to build the solution, you can specify `-noBuild` or `-no
How to create a project named `SomeCoolProject`, a unit tests project, and a functional tests project in the default, existing, solution with each test project importing its own `props` file.
144
+
This command also includes the `-no-build` flag which can become handy when `GenerateDocumentationFile` is set to `true` and `TreatWarningsAsErrors` is also set to `true` (in a `Directory.Build.props` file for example).
|`-projectName`|`-p`| No | Yes | 1.1.0 || The name of the project that you want to create, for exmaple: `SomeCoolProject`. |
157
+
|`-solutionName`|`-s`| No | No | 1.1.0 || The name of the solution to add your functional tests project to if there is more than one in the directory. |
158
+
|`-noBuild`|`-no-build`| Yes | No | 1.1.0 || If specified, `dotnet build` will not run after the projects creation. |
159
+
|`-customPropsFile`|`-props`| No | No | 1.1.0 |`$null`| Allow specifying a `.props` file that will be imported at the top of the functional test project. |
160
+
161
+
#### How to use
162
+
163
+
How to create a functional tests project for the project `SomeCoolProject`:
164
+
165
+
```powershell
166
+
Add-FunctionalTests -p SomeCoolProject
167
+
```
168
+
169
+
> This will create a xunit project into `test/SomeCoolProject.FunctionalTests` linked to `src/SomeCoolProject`.
170
+
171
+
How to create a functional tests project for the project `SomeCoolProject` and include a `props` file located into `test/FunctionalTests.Build.props`:
0 commit comments