Skip to content

Instantly share code, notes, and snippets.

View ManfredLange's full-sized avatar
💭
Key to a team's success: collaboration and communication!

Manfred Lange ManfredLange

💭
Key to a team's success: collaboration and communication!
View GitHub Profile
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.21.0" />
{
"CosmosDb": {
"Documentation": "https://docs.microsoft.com/en-us/azure/cosmos-db/linux-emulator",
"EndpointUri": "https://demo-database.local:8081",
"PrimaryKey": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="
}
}
namespace CosmosDbTest
{
public class CosmosDbTests
{
[OneTimeTearDown]
public void OneTimeTearDown()
{
//Dispose of CosmosClient
_cosmosClient.Dispose(); // Move this to teardown of fixture
}
using Microsoft.Extensions.Configuration;
using NUnit.Framework;
namespace CosmosDbTest
{
[SetUpFixture]
public static class TestSuite
{
static TestSuite()
{
# Name of the project so that services specified in docker-compose for this project
# use the virtual network of that name:
COMPOSE_PROJECT_NAME=cosmosdb-demo-project
#requires -PSEdition Core
# Additional steps to initialize the development container can be added in this file
# Note: this file is executed as a non-root user.
#!/bin/sh
echo Running entrypoint.sh
#################################################################################################################
# Provided the Dockerfile doesn't change the user, this script will run as 'root'. However, once VS Code connects
# it will connect remotely as user 'dev' [Manfred, 19sep2021]
#################################################################################################################
FROM mcr.microsoft.com/dotnet/sdk:5.0.401
# For other base images, check https://hub.docker.com/_/microsoft-dotnet-sdk/
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y procps iputils-ping net-tools
# procps: to support command 'ps'
# iputils-ping: to support command 'ping' (https://linuxconfig.org/ping-command-not-found-on-ubuntu-20-04-focal-fossa-linux) [Manfred, 19sep2021]
# net-tools: to support command such as 'arp', 'ifconfig', 'netstat', etc. (https://helpmanual.io/packages/apt/net-tools/) [Manfred, 26sep2021]
version: '3.7'
services:
cosmosdb-demo:
container_name: cosmosdb-demo-dev
hostname: demo-dev.local
build:
context: .
working_dir: /src
volumes: