forked from g0t4/aspnetcore-generator-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed framework to 2.0.0 from 2.0.0-preview1 g0t4#3
- Loading branch information
Showing
8 changed files
with
124 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
**/bin/ | ||
**/obj/ | ||
**/.vs/ | ||
**/.git/ | ||
infra/ | ||
**/global.json | ||
**/Dockerfile* | ||
**/.dockerignore* | ||
**/docker-compose*.yml | ||
**/*.user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# build stage | ||
FROM microsoft/aspnetcore-build:2 as build-env | ||
|
||
WORKDIR /generator | ||
|
||
# restore | ||
COPY api/api.csproj ./api/ | ||
RUN dotnet restore api/api.csproj | ||
COPY tests/tests.csproj ./tests/ | ||
RUN dotnet restore tests/tests.csproj | ||
|
||
# copy src | ||
COPY . . | ||
|
||
# test | ||
RUN dotnet test tests/tests.csproj | ||
|
||
# publish | ||
RUN dotnet publish api/api.csproj -o /publish | ||
|
||
# runtime stage | ||
FROM microsoft/aspnetcore:2 | ||
COPY --from=build-env /publish /publish | ||
WORKDIR /publish | ||
ENTRYPOINT [ "dotnet", "api.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"sdk": { | ||
"version": "2.0.0-preview1-005977" | ||
"version": "2.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: '3.1' | ||
|
||
services: | ||
my-registry: | ||
image: registry:2.6.1 | ||
volumes: | ||
- registry:/var/lib/registry | ||
ports: | ||
- "55000:5000" | ||
restart: unless-stopped | ||
|
||
volumes: | ||
registry: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: '3.1' | ||
|
||
services: | ||
teamcity: | ||
image: jetbrains/teamcity-server:2017.1.2 | ||
volumes: | ||
- teamcity-server-datadir:/data/teamcity_server/datadir | ||
- teamcity-server-logs:/opt/teamcity/logs | ||
ports: | ||
- 8111:8111 | ||
teamcity-agent: | ||
image: jetbrains/teamcity-agent:2017.1.2 | ||
environment: | ||
SERVER_URL: http://teamcity:8111 | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
|
||
|
||
volumes: | ||
teamcity-server-datadir: | ||
teamcity-server-logs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Linq; | ||
using api.Controllers; | ||
using Xunit; | ||
|
||
namespace tests | ||
{ | ||
public class RangeTests | ||
{ | ||
[Fact] | ||
public void CountShouldControlNumberOfResults() | ||
{ | ||
var range = new Range { Count = 3 }; | ||
|
||
var generated = range.Of(() => ""); | ||
|
||
Assert.Equal(3, generated.Count()); | ||
} | ||
|
||
[Fact] | ||
public void SortShouldOrderResults() | ||
{ | ||
var range = new Range { Count = 3, Sort = true }; | ||
var values = new[] { "a", "c", "b" }; | ||
var counter = 0; | ||
var generated = range.Of(() => values[counter++]); | ||
|
||
Assert.Equal(new[] { "a", "b", "c" }, generated.ToArray()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170628-02" /> | ||
<PackageReference Include="xunit" Version="2.2.0" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\api\api.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |