Skip to content

Instantly share code, notes, and snippets.

View acraven's full-sized avatar

Andrew Craven acraven

  • Epworth Consulting Ltd.
View GitHub Profile
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;
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
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
{
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;
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
{
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
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
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
version: "3"
services:
app:
build:
context: app
args:
version: 0.0.0
environment:
- KESTREL__ENDPOINTS__HTTP__URL=http://*:5000
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