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
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microservice.Model; | |
using Microsoft.Extensions.Configuration; | |
using MongoDB.Bson; | |
using MongoDB.Bson.Serialization; | |
using MongoDB.Bson.Serialization.Serializers; | |
using MongoDB.Driver; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Threading.Tasks; | |
using Microservice.Components; | |
using Microservice.Model; | |
using MongoDB.Driver; | |
namespace Microservice.Dependencies.ObjectStore.MongoDb |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Threading.Tasks; | |
using Microservice.Components; | |
using Microservice.Model; | |
namespace Microservice.Dependencies.ObjectStore.InMemory | |
{ |
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
using System; | |
using System.ComponentModel.DataAnnotations; | |
using System.Globalization; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microservice.Controllers.Model; | |
using Microservice.Dependencies.ObjectStore; | |
using Microservice.Model; | |
using Microsoft.AspNetCore.Mvc; |
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
using System.Net; | |
using System.Threading.Tasks; | |
using FluentAssertions.Json; | |
using Newtonsoft.Json.Linq; | |
using NUnit.Framework; | |
namespace Microservice.OutsideIn.Tests | |
{ | |
public class RetrieveOneContact : ScenarioBase | |
{ |
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
using System; | |
using System.Net; | |
using System.Net.Http; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json; | |
namespace Microservice.OutsideIn.Tests | |
{ | |
public abstract class ScenarioBase |
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
mkdir microservice-outsidein-tests | |
cd microservice-outsidein-tests | |
dotnet new webapi -n Microservice -o app\Microservice | |
dotnet new nunit -n Microservice.Tests -o app\Microservice.Tests | |
dotnet new nunit -n Microservice.OutsideIn.Tests -o outside-in.tests\Microservice.OutsideIn.Tests | |
dotnet new sln | |
dotnet sln add .\app\Microservice\Microservice.csproj .\app\Microservice.Tests\Microservice.Tests.csproj .\outside-in.tests\Microservice.OutsideIn.Tests\Microservice.OutsideIn.Tests.csproj |
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
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS build | |
WORKDIR /build | |
COPY ./Microservice.OutsideIn.Tests/Microservice.OutsideIn.Tests.csproj ./Microservice.OutsideIn.Tests/Microservice.OutsideIn.Tests.csproj | |
RUN dotnet restore ./Microservice.OutsideIn.Tests/Microservice.OutsideIn.Tests.csproj | |
COPY . . | |
RUN dotnet build --no-incremental -c Release ./Microservice.OutsideIn.Tests/Microservice.OutsideIn.Tests.csproj |
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
version: "3" | |
services: | |
app: | |
build: | |
context: app | |
args: | |
version: 0.0.0 | |
environment: | |
- KESTREL__ENDPOINTS__HTTP__URL=http://*:5000 |
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
docker-compose -f docker-compose.build.yaml build --no-cache --parallel | |
if ($? -eq $false) { | |
exit | |
} | |
docker-compose -f docker-compose.build.yaml up --renew-anon-volumes --abort-on-container-exit outside-in.tests |
NewerOlder