Skip to content

Commit 3b80afc

Browse files
authored
Merge pull request #1 from geeklearningio/develop
Develop
2 parents 7d99f1f + 424ac53 commit 3b80afc

Some content is hidden

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

41 files changed

+1047
-19
lines changed

GeekLearning.Test.Integration.sln

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "items", "items", "{54842458
99
ProjectSection(SolutionItems) = preProject
1010
.gitignore = .gitignore
1111
global.json = global.json
12+
NuGet.Config = NuGet.Config
1213
EndProjectSection
1314
EndProject
1415
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "GeekLearning.Test.Integration", "src\GeekLearning.Test.Integration\GeekLearning.Test.Integration.xproj", "{F28C9E50-7EB0-4368-9812-8EE693648E78}"
1516
EndProject
17+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{36903259-F63B-480F-9F84-005D0A2BA8DA}"
18+
EndProject
19+
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}"
20+
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}"
22+
EndProject
1623
Global
1724
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1825
Debug|Any CPU = Debug|Any CPU
@@ -23,11 +30,21 @@ Global
2330
{F28C9E50-7EB0-4368-9812-8EE693648E78}.Debug|Any CPU.Build.0 = Debug|Any CPU
2431
{F28C9E50-7EB0-4368-9812-8EE693648E78}.Release|Any CPU.ActiveCfg = Release|Any CPU
2532
{F28C9E50-7EB0-4368-9812-8EE693648E78}.Release|Any CPU.Build.0 = Release|Any CPU
33+
{0C607AE8-92C3-4589-9B4A-601BE6CF62B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34+
{0C607AE8-92C3-4589-9B4A-601BE6CF62B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
35+
{0C607AE8-92C3-4589-9B4A-601BE6CF62B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
36+
{0C607AE8-92C3-4589-9B4A-601BE6CF62B2}.Release|Any CPU.Build.0 = Release|Any CPU
37+
{6F96D2CD-B8EC-47AA-ADB1-9BE120254E39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38+
{6F96D2CD-B8EC-47AA-ADB1-9BE120254E39}.Debug|Any CPU.Build.0 = Debug|Any CPU
39+
{6F96D2CD-B8EC-47AA-ADB1-9BE120254E39}.Release|Any CPU.ActiveCfg = Release|Any CPU
40+
{6F96D2CD-B8EC-47AA-ADB1-9BE120254E39}.Release|Any CPU.Build.0 = Release|Any CPU
2641
EndGlobalSection
2742
GlobalSection(SolutionProperties) = preSolution
2843
HideSolutionNode = FALSE
2944
EndGlobalSection
3045
GlobalSection(NestedProjects) = preSolution
3146
{F28C9E50-7EB0-4368-9812-8EE693648E78} = {033A6692-6022-469D-A0E7-B9C636CA05A8}
47+
{0C607AE8-92C3-4589-9B4A-601BE6CF62B2} = {36903259-F63B-480F-9F84-005D0A2BA8DA}
48+
{6F96D2CD-B8EC-47AA-ADB1-9BE120254E39} = {36903259-F63B-480F-9F84-005D0A2BA8DA}
3249
EndGlobalSection
3350
EndGlobal

GitVersion.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
branches:
2+
dev(elop)?(ment)?$:
3+
tag: alpha
4+
features?[/-]:
5+
tag: alpha.{BranchName}
6+
releases?[/-]:
7+
mode: ContinuousDeployment
8+
hotfix(es)?[/-]:
9+
mode: ContinuousDeployment

NuGet.Config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="GL Unstable" value="https://www.myget.org/F/gl-unstable/api/v3/index.json" />
5+
</packageSources>
6+
</configuration>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"projects": [ "src", "test" ],
2+
"projects": [ "src", "sample", "test" ],
33
"sdk": {
44
"version": "1.0.0-preview2-003121"
55
}
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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Feature: Get blogs
2+
In order to list blogs
3+
I want to be told a list of blogs
4+
5+
Background:
6+
Given A configured environment
7+
8+
Scenario: Get blogs should be ok
9+
Given the following blogs
10+
| Url |
11+
| http://blog1.io |
12+
| http://blog2.io |
13+
| http://blog3.io |
14+
When I get the list of blogs
15+
Then the result must be the following list
16+
| Url |
17+
| http://blog1.io |
18+
| http://blog2.io |
19+
| http://blog3.io |

sample/GeekLearning.Test.Integration.Sample.Test/GetBlogs/GetBlogs.feature.cs

Lines changed: 139 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using GeekLearning.Test.Integration.Environment;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using TechTalk.SpecFlow;
7+
using TechTalk.SpecFlow.Assist;
8+
using System.Net.Http;
9+
using GeekLearning.Test.Integration.Sample.Data;
10+
using Microsoft.Extensions.DependencyInjection;
11+
12+
namespace GeekLearning.Test.Integration.Sample.Test.GetBlogs
13+
{
14+
[Binding]
15+
public class GetBlogsSteps
16+
{
17+
[Given(@"the following blogs")]
18+
public void GivenTheFollowingBlogs(Table table)
19+
{
20+
var apiTestEnvironment = ScenarioContext.Current.Get<ITestEnvironment>("ApiTestEnvironment");
21+
using (var serviceScope = apiTestEnvironment.ServiceProvider.GetRequiredService<IServiceScopeFactory>().CreateScope())
22+
{
23+
var dbContext = serviceScope.ServiceProvider.GetService<Data.BloggingContext>();
24+
var blogSet = table.CreateSet<Data.Blog>();
25+
dbContext.Blogs.AddRange(blogSet);
26+
dbContext.SaveChanges();
27+
}
28+
}
29+
30+
[When(@"I get the list of blogs")]
31+
public void WhenIGetTheListOfBlogs()
32+
{
33+
var apiTestEnvironment = ScenarioContext.Current.Get<ITestEnvironment>("ApiTestEnvironment");
34+
var response = apiTestEnvironment.Client.GetAsync("/api/blogs").Result;
35+
response.EnsureSuccessStatusCode();
36+
37+
var result = response.Content.ReadAsAsync<Blog[]>().Result;
38+
39+
ScenarioContext.Current.Add("result", result);
40+
}
41+
42+
[Then(@"the result must be the following list")]
43+
public void ThenTheResultMustBeTheFollowingList(Table expectedResult)
44+
{
45+
expectedResult.CreateSet<Blog>()
46+
.IsEqual(ScenarioContext.Current.Get<IEnumerable<Blog>>("result"), ignoredProperties: "BlogId");
47+
}
48+
}
49+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using GeekLearning.Test.Integration.Environment;
2+
using GeekLearning.Test.Integration.Sample.Data;
3+
using TechTalk.SpecFlow;
4+
5+
namespace GeekLearning.Test.Integration.Sample.Test
6+
{
7+
[Binding]
8+
public class MainSteps
9+
{
10+
[Given(@"A configured environment")]
11+
public void GivenAWorkingEnvironment()
12+
{
13+
ScenarioContext.Current.Add(
14+
"ApiTestEnvironment",
15+
new TestEnvironment<Startup, TestStartupConfigurationService<BloggingContext>>());
16+
17+
// add additional data configuration here
18+
}
19+
}
20+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyConfiguration("")]
9+
[assembly: AssemblyCompany("")]
10+
[assembly: AssemblyProduct("GeekLearning.Test.Integration.Sample.Test")]
11+
[assembly: AssemblyTrademark("")]
12+
13+
// Setting ComVisible to false makes the types in this assembly not visible
14+
// to COM components. If you need to access a type in this assembly from
15+
// COM, set the ComVisible attribute to true on that type.
16+
[assembly: ComVisible(false)]
17+
18+
// The following GUID is for the ID of the typelib if this project is exposed to COM
19+
[assembly: Guid("6f96d2cd-b8ec-47aa-adb1-9be120254e39")]

0 commit comments

Comments
 (0)