Skip to content

Commit bbfffe9

Browse files
committed
Update dependencies + readme
1 parent 680fbcf commit bbfffe9

File tree

9 files changed

+36
-39
lines changed

9 files changed

+36
-39
lines changed

NuGet.Config

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
[![NuGet Version](http://img.shields.io/nuget/v/GeekLearning.Testavior.svg?style=flat-square&label=NuGet:%20Testavior)](https://www.nuget.org/packages/GeekLearning.Testavior/)
2+
[![NuGet Version](http://img.shields.io/nuget/v/GeekLearning.Testavior.Configuration.svg?style=flat-square&label=NuGet:%20Testavior.Configuration)](https://www.nuget.org/packages/GeekLearning.Testavior.Configuration/)
3+
[![Build Status](https://geeklearning.visualstudio.com/_apis/public/build/definitions/f841b266-7595-4d01-9ee1-4864cf65aa73/62/badge)](#)
14
# Testavior
2-
*Testavior* is a set of [NuGet libraries]() to help you develop **Behavior** Tests for **ASP.NET Core**.
5+
*Testavior* is a [lightweight solution](https://www.nuget.org/packages?q=Testavior) to help you develop **Behavior** Tests for **ASP.NET Core**.
36

47
>Behavior Tests are a way of testing your application features applying different types of behaviors to cover a **functional scenario**.
58
@@ -8,8 +11,8 @@ For more information about *Behavior Testing* with ASP.NET Core, please take a l
811

912
### Features
1013
*Testavior* provides 2 libraries:
11-
* **Configuration**: Helps you configure your application to easily integrate behavior tests for your scenarios.
12-
* **Integration**: Provides a featured and highly configurable test environment for your behavior tests:
14+
* **Testavior.Configuration**: Helps you configure your application to easily integrate behavior tests for your scenarios.
15+
* **Testavior**: Provides a featured and highly configurable test environment for your behavior tests:
1316
* Configured Test WebHost
1417
* Configured authentication context
1518
* Test authentication middleware
@@ -22,19 +25,19 @@ For more information about *Behavior Testing* with ASP.NET Core, please take a l
2225

2326
### Installation
2427
On your ASP.NET Core project
25-
* Install the **GeekLearning.SceneTest.Configuration** nuget package
28+
* Install the **GeekLearning.Testavior.Configuration** nuget package
2629
```
2730
> dotnet add package GeekLearning.Testavior.Configuration
2831
```
2932

3033
On your .NET Core Unit Test project
31-
* Install the **GeekLearning.SceneTest** nuget package
34+
* Install the **GeekLearning.Testavior** nuget package
3235
```
3336
> dotnet add package GeekLearning.Testavior
3437
```
3538
* Add your ASP.NET Core web project as a project reference
3639
### Configuration
37-
The Test environment provided by *SceneTest* is based on a **Startup Configuration Service** that let you separate the **Production** environment configuration from the **Test** environment configuration.
40+
The Test environment provided by *Testavior* is based on a **Startup Configuration Service** that let you separate the **Production** environment configuration from the **Test** environment configuration.
3841
This configuration service is represented by a contract **IStartupConfigurationService** which define 3 methods: *Configure, ConfigureEnvironment, ConfigureService* that have to be called within the **Startup Routine** to inject environment dependent configuration.
3942

4043
1 - In your **ASP.NET Core** project:
@@ -55,7 +58,7 @@ This configuration service is represented by a contract **IStartupConfigurationS
5558

5659
var connection = "CONNECTION_STRING";
5760

58-
services.AddDbContext<Data.BloggingContext>(options =>
61+
services.AddDbContext<[EF_DB_CONTEXT]>(options =>
5962
options.UseSqlServer(connection));
6063
}
6164
}
@@ -111,7 +114,7 @@ A specific *IStartupConfigurationService* is required for the **Test** environme
111114
*Testavior* comes with a test specific *IStartupConfigurationService* implementation: **TestStartupConfigurationService** which provide a **Test Environment** full of useful features (see **Features** section).
112115
Of course you can implement your own *Test StartupConfigurationService* (by using the onboard TestStartupConfigurationService or not).
113116

114-
To create a *Test Environment*, just instanciate the **TestEnvironment** class by passing it your ASP.NET Core application *Startup*, your *IStartupConfigurationService* implementation and the type of your EF Core ObjectContext
117+
To create a *Test Environment*, just instanciate the **TestEnvironment** class by passing it your ASP.NET Core application *Startup*, your *IStartupConfigurationService* implementation, the type of your EF Core ObjectContext and the relative path to your ASP.NET Core project (required to resolve MVC views).
115118
```csharp
116119
var testEnvironment = new TestEnvironment<Startup, TestStartupConfigurationService<[EF_DB_CONTEXT]>>(
117120
Path.Combine(System.AppContext.BaseDirectory, @"[PATH_TO_WEB_APP]"));
@@ -134,7 +137,6 @@ public void ScenarioShouldBeOk()
134137

135138
Assert.AreEqual("data", result.Data);
136139
}
137-
...
138140
```
139141

140142
#### MVC Test

sample/Sample.Test.Splecflow/Sample.Test.Splecflow.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
<ItemGroup>
1616
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
17-
<PackageReference Include="MSTest.TestAdapter" Version="1.1.14" />
18-
<PackageReference Include="MSTest.TestFramework" Version="1.1.14" />
17+
<PackageReference Include="MSTest.TestAdapter" Version="1.1.17" />
18+
<PackageReference Include="MSTest.TestFramework" Version="1.1.17" />
1919
<PackageReference Include="SpecFlow" Version="2.1.0" />
2020
<PackageReference Include="SpecFlow.NetCore" Version="1.0.0-rc8" />
2121
</ItemGroup>

sample/Sample.Test/Sample.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
14-
<PackageReference Include="MSTest.TestAdapter" Version="1.1.14" />
15-
<PackageReference Include="MSTest.TestFramework" Version="1.1.14" />
14+
<PackageReference Include="MSTest.TestAdapter" Version="1.1.17" />
15+
<PackageReference Include="MSTest.TestFramework" Version="1.1.17" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

sample/Sample.Web/Controllers/Api/BlogsController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public BlogsController(BloggingContext context)
1717
}
1818

1919
[HttpGet]
20+
[Microsoft.AspNetCore.Authorization.Authorize]
2021
public async Task<IEnumerable<Blog>> GeBlogs()
2122
{
2223
return await this.context.Blogs.ToListAsync();

sample/Sample.Web/Sample.Web.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
</ItemGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
13-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
14-
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
15-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.1" />
16-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.0" />
17-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
18-
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" />
12+
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" />
13+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
14+
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.2" />
15+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />
16+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.1" />
17+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
18+
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.2" />
1919
</ItemGroup>
2020

2121
<ItemGroup>

sample/Sample.Web/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public Startup(IHostingEnvironment env, IStartupConfigurationService externalSta
2121
public void ConfigureServices(IServiceCollection services)
2222
{
2323
services
24-
.AddMvc(c => c.Filters.Add(new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build())))
24+
.AddMvc(/*c => c.Filters.Add(new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build()))*/)
2525
.AddFilterCollection();
2626

2727
// Pass configuration (IConfigurationRoot) to the configuration service if needed

src/GeekLearning.Testavior.Configuration/GeekLearning.Testavior.Configuration.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
</PropertyGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="1.1.1" />
20-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.1.2" />
19+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="1.1.2" />
20+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.1.3" />
2121
</ItemGroup>
2222

2323
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">

src/GeekLearning.Testavior/GeekLearning.Testavior.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
</ItemGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="1.1.1" />
24-
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="1.1.1" />
25-
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="1.1.1" />
26-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="1.1.2" />
27-
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="1.1.2" />
28-
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="1.1.1" />
29-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="1.1.1" />
30-
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="1.1.1" />
31-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="1.1.0" />
32-
<PackageReference Include="Microsoft.Extensions.Options" Version="1.1.1" />
23+
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="1.1.2" />
24+
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="1.1.2" />
25+
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="1.1.2" />
26+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="1.1.3" />
27+
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="1.1.3" />
28+
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="1.1.2" />
29+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="1.1.2" />
30+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="1.1.2" />
31+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="1.1.1" />
32+
<PackageReference Include="Microsoft.Extensions.Options" Version="1.1.2" />
3333
</ItemGroup>
3434

3535
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">

0 commit comments

Comments
 (0)