Commit ae91061f authored by Michal Dymel's avatar Michal Dymel

adding tests project

parent cbb57c2b
Pipeline #9694411 passed with stage
in 2 minutes and 39 seconds
bin/
obj/
\ No newline at end of file
*/*/bin/
*/*/obj/
\ No newline at end of file
......@@ -3,12 +3,18 @@ FROM microsoft/aspnetcore-build AS builder
WORKDIR /source
# caches restore result by copying csproj file separately
COPY *.csproj .
RUN dotnet restore
COPY src/aspdocker/aspdocker.csproj ./src/aspdocker/
RUN dotnet restore ./src/aspdocker/aspdocker.csproj
COPY src/aspdocker.tests/aspdocker.tests.csproj ./src/aspdocker.tests/
RUN dotnet restore ./src/aspdocker.tests/aspdocker.tests.csproj
# copies the rest of your code
COPY . .
RUN dotnet publish --output /app/ --configuration Release
RUN dotnet test ./src/aspdocker.tests/aspdocker.tests.csproj
RUN dotnet publish ./src/aspdocker/aspdocker.csproj --output /app/ --configuration Release
# Stage 2
FROM microsoft/aspnetcore
......
using System;
using Xunit;
namespace aspdocker.tests
{
public class UnitTest1
{
[Fact]
public void Test1()
{
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
</ItemGroup>
</Project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment