Skip to content

Commit fa83679

Browse files
authored
Merge pull request #8 from geeklearningio/develop
Develop -> Master
2 parents b80818d + 5733a5e commit fa83679

File tree

57 files changed

+1092
-448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1092
-448
lines changed

GeekLearning.Test.Integration.sln

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{369032
1818
EndProject
1919
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "GeekLearning.Test.Integration.Sample.Web", "sample\GeekLearning.Test.Integration.Sample.Web\GeekLearning.Test.Integration.Sample.Web.xproj", "{0C607AE8-92C3-4589-9B4A-601BE6CF62B2}"
2020
EndProject
21-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "GeekLearning.Test.Integration.Sample.Test", "sample\GeekLearning.Test.Integration.Sample.Test\GeekLearning.Test.Integration.Sample.Test.xproj", "{6F96D2CD-B8EC-47AA-ADB1-9BE120254E39}"
21+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "GeekLearning.Test.Configuration", "src\GeekLearning.Test.Configuration\GeekLearning.Test.Configuration.xproj", "{9146CE74-6610-472E-8FC8-3AEF733868D0}"
22+
EndProject
23+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "GeekLearning.Test.Integration.Sample.Test.Specflow", "sample\GeekLearning.Test.Integration.Sample.Test.Splecflow\GeekLearning.Test.Integration.Sample.Test.Specflow.xproj", "{6F96D2CD-B8EC-47AA-ADB1-9BE120254E39}"
24+
EndProject
25+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "GeekLearning.Test.Integration.Sample.Test", "sample\GeekLearning.Test.Integration.Sample.Test\GeekLearning.Test.Integration.Sample.Test.xproj", "{729DBF60-93DF-4CBA-B809-142C0B42D397}"
26+
EndProject
27+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "specflow", "specflow", "{D6AF528A-BA8D-47D7-BAD0-810154BB0FD9}"
2228
EndProject
2329
Global
2430
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -34,17 +40,28 @@ Global
3440
{0C607AE8-92C3-4589-9B4A-601BE6CF62B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
3541
{0C607AE8-92C3-4589-9B4A-601BE6CF62B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
3642
{0C607AE8-92C3-4589-9B4A-601BE6CF62B2}.Release|Any CPU.Build.0 = Release|Any CPU
43+
{9146CE74-6610-472E-8FC8-3AEF733868D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
44+
{9146CE74-6610-472E-8FC8-3AEF733868D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
45+
{9146CE74-6610-472E-8FC8-3AEF733868D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
46+
{9146CE74-6610-472E-8FC8-3AEF733868D0}.Release|Any CPU.Build.0 = Release|Any CPU
3747
{6F96D2CD-B8EC-47AA-ADB1-9BE120254E39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3848
{6F96D2CD-B8EC-47AA-ADB1-9BE120254E39}.Debug|Any CPU.Build.0 = Debug|Any CPU
3949
{6F96D2CD-B8EC-47AA-ADB1-9BE120254E39}.Release|Any CPU.ActiveCfg = Release|Any CPU
4050
{6F96D2CD-B8EC-47AA-ADB1-9BE120254E39}.Release|Any CPU.Build.0 = Release|Any CPU
51+
{729DBF60-93DF-4CBA-B809-142C0B42D397}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
52+
{729DBF60-93DF-4CBA-B809-142C0B42D397}.Debug|Any CPU.Build.0 = Debug|Any CPU
53+
{729DBF60-93DF-4CBA-B809-142C0B42D397}.Release|Any CPU.ActiveCfg = Release|Any CPU
54+
{729DBF60-93DF-4CBA-B809-142C0B42D397}.Release|Any CPU.Build.0 = Release|Any CPU
4155
EndGlobalSection
4256
GlobalSection(SolutionProperties) = preSolution
4357
HideSolutionNode = FALSE
4458
EndGlobalSection
4559
GlobalSection(NestedProjects) = preSolution
4660
{F28C9E50-7EB0-4368-9812-8EE693648E78} = {033A6692-6022-469D-A0E7-B9C636CA05A8}
4761
{0C607AE8-92C3-4589-9B4A-601BE6CF62B2} = {36903259-F63B-480F-9F84-005D0A2BA8DA}
48-
{6F96D2CD-B8EC-47AA-ADB1-9BE120254E39} = {36903259-F63B-480F-9F84-005D0A2BA8DA}
62+
{9146CE74-6610-472E-8FC8-3AEF733868D0} = {033A6692-6022-469D-A0E7-B9C636CA05A8}
63+
{6F96D2CD-B8EC-47AA-ADB1-9BE120254E39} = {D6AF528A-BA8D-47D7-BAD0-810154BB0FD9}
64+
{729DBF60-93DF-4CBA-B809-142C0B42D397} = {36903259-F63B-480F-9F84-005D0A2BA8DA}
65+
{D6AF528A-BA8D-47D7-BAD0-810154BB0FD9} = {36903259-F63B-480F-9F84-005D0A2BA8DA}
4966
EndGlobalSection
5067
EndGlobal

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"projects": [ "src", "sample", "test" ],
33
"sdk": {
4-
"version": "1.0.0-preview2-003121"
4+
"version": "1.0.0-preview2-1-003177"
55
}
66
}

sample/GeekLearning.Test.Integration.Sample.Test/GetBlogs/GetBlogs.feature renamed to sample/GeekLearning.Test.Integration.Sample.Test.Splecflow/Api/GetBlogs/GetBlogs.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Scenario: Get blogs should be ok
1111
| http://blog1.io |
1212
| http://blog2.io |
1313
| http://blog3.io |
14-
When I get the list of blogs
14+
When I get the list of blogs from Api
1515
Then the result must be the following list
1616
| Url |
1717
| http://blog1.io |

sample/GeekLearning.Test.Integration.Sample.Test/GetBlogs/GetBlogs.feature.cs renamed to sample/GeekLearning.Test.Integration.Sample.Test.Splecflow/Api/GetBlogs/GetBlogs.feature.cs

Lines changed: 17 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
namespace GeekLearning.Test.Integration.Sample.Test.GetBlogs.Api
2+
{
3+
using Data;
4+
using Environment;
5+
using System.Collections.Generic;
6+
using System.Net.Http;
7+
using TechTalk.SpecFlow;
8+
using TechTalk.SpecFlow.Assist;
9+
10+
[Binding]
11+
public class GetBlogsSteps
12+
{
13+
[When(@"I get the list of blogs from Api")]
14+
public void WhenIGetTheListOfBlogs()
15+
{
16+
var testEnvironment = ScenarioContext.Current.Get<ITestEnvironment>("TestEnvironment");
17+
var response = testEnvironment.Client.GetAsync("/api/blogs").Result;
18+
response.EnsureSuccessStatusCode();
19+
20+
var result = response.Content.ReadAsAsync<Blog[]>().Result;
21+
22+
ScenarioContext.Current.Add("result", result);
23+
}
24+
25+
[Then(@"the result must be the following list")]
26+
public void ThenTheResultMustBeTheFollowingList(Table expectedResult)
27+
{
28+
expectedResult.CreateSet<Blog>()
29+
.IsEqual(ScenarioContext.Current.Get<IEnumerable<Blog>>("result"), ignoredProperties: "BlogId");
30+
}
31+
}
32+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
8+
<PropertyGroup Label="Globals">
9+
<ProjectGuid>6f96d2cd-b8ec-47aa-adb1-9be120254e39</ProjectGuid>
10+
<RootNamespace>GeekLearning.Test.Integration.Sample.Test</RootNamespace>
11+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
13+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
14+
</PropertyGroup>
15+
<PropertyGroup>
16+
<SchemaVersion>2.0</SchemaVersion>
17+
</PropertyGroup>
18+
<ItemGroup>
19+
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
20+
</ItemGroup>
21+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
22+
</Project>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
namespace GeekLearning.Test.Integration.Sample.Test
2+
{
3+
using Data;
4+
using Environment;
5+
using Microsoft.Extensions.DependencyInjection;
6+
using System.IO;
7+
using TechTalk.SpecFlow;
8+
using TechTalk.SpecFlow.Assist;
9+
10+
[Binding]
11+
public class MainSteps
12+
{
13+
[Given(@"A configured environment")]
14+
public void GivenAWorkingEnvironment()
15+
{
16+
ScenarioContext.Current.Add(
17+
"TestEnvironment",
18+
new TestEnvironment<Startup, TestStartupConfigurationService<BloggingContext>>(
19+
Path.Combine(Directory.GetCurrentDirectory(), @"..\..\..\..\..\GeekLearning.Test.Integration.Sample.Web")));
20+
21+
// add additional data configuration here
22+
}
23+
24+
[Given(@"the following blogs")]
25+
public void GivenTheFollowingBlogs(Table table)
26+
{
27+
var apiTestEnvironment = ScenarioContext.Current.Get<ITestEnvironment>("TestEnvironment");
28+
using (var serviceScope = apiTestEnvironment.ServiceProvider.GetRequiredService<IServiceScopeFactory>().CreateScope())
29+
{
30+
var dbContext = serviceScope.ServiceProvider.GetService<Data.BloggingContext>();
31+
var blogSet = table.CreateSet<Data.Blog>();
32+
dbContext.Blogs.AddRange(blogSet);
33+
dbContext.SaveChanges();
34+
}
35+
}
36+
}
37+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Feature: Create blog
2+
In order to provide a new blog
3+
I want to be able to create a blog
4+
5+
Background:
6+
Given A configured environment
7+
8+
Scenario: Create a blog should be ok
9+
When I create a new blog : 'http://newblog.io'
10+
Then the blog 'http://newblog.io' must be created

sample/GeekLearning.Test.Integration.Sample.Test.Splecflow/Mvc/CreateBlog/CreateBlog.feature.cs

Lines changed: 99 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)