This repository was archived by the owner on Jan 27, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
test/Winton.DomainModelling.DocumentDb.IntegrationTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,16 +3,24 @@ environment:
33 CLI_VERSION : latest
44 DOTNET_CLI_TELEMETRY_OPTOUT : 1
55 DOTNET_SKIP_FIRST_TIME_EXPERIENCE : true
6+ DOCUMENT_DB_URI : https://localhost:8081
7+ DOCUMENT_DB_KEY : C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
68image : Visual Studio 2017
79configuration :
810 - Release
911skip_tags : true
12+ install :
13+ - ps : Start-FileDownload "https://aka.ms/cosmosdb-emulator" -FileName "C:\Azure Cosmos DB.Emulator.msi"
14+ - cmd : cmd /c start /wait msiexec /i "C:\Azure Cosmos DB.Emulator.msi" /qn /quiet /norestart /log install.log
15+ - ps : Start-Process "C:\Program Files\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" -ArgumentList "/NoExplorer","/NoUI"
16+ - ps : Start-Sleep -s 15
1017before_build :
1118 - dotnet restore
1219build_script :
1320 - msbuild /p:GetVersion=True /p:WriteVersionInfoToBuildLog=True
1421test_script :
1522 - dotnet test test/Winton.DomainModelling.DocumentDb.Tests/ --no-build --configuration Release
23+ - dotnet test test/Winton.DomainModelling.DocumentDb.IntegrationTests/ --no-build --configuration Release
1624artifacts :
1725- path : .\**\*.nupkg
1826 name : NuGet
Original file line number Diff line number Diff line change @@ -22,14 +22,15 @@ public class EntityFacadeTests : IDisposable
2222
2323 public EntityFacadeTests ( )
2424 {
25- string documentDbUri = Environment . GetEnvironmentVariable ( nameof ( documentDbUri ) ) ;
26- string documentDbReadWriteKey = Environment . GetEnvironmentVariable ( nameof ( documentDbReadWriteKey ) ) ;
27- string databaseId = Environment . GetEnvironmentVariable ( nameof ( databaseId ) ) ;
28-
29- _documentClient = new DocumentClient ( new Uri ( documentDbUri ) , documentDbReadWriteKey ) ;
30- _database = _documentClient . CreateDatabaseIfNotExistsAsync ( new Database { Id = databaseId } ) . Result . Resource ;
25+ string documentDbUri = Environment . GetEnvironmentVariable ( "DOCUMENT_DB_URI" ) ;
26+ string documentDbKey = Environment . GetEnvironmentVariable ( "DOCUMENT_DB_KEY" ) ;
3127
28+ var database = new Database { Id = nameof ( EntityFacadeTests ) } ;
3229 var documentCollection = new DocumentCollection { Id = nameof ( EntityFacadeTests ) } ;
30+
31+ _documentClient = new DocumentClient ( new Uri ( documentDbUri ) , documentDbKey ) ;
32+ _database = _documentClient . CreateDatabaseIfNotExistsAsync ( database ) . Result . Resource ;
33+
3334 var requestOptions = new RequestOptions { OfferThroughput = 400 } ;
3435 _documentClient . CreateDocumentCollectionIfNotExistsAsync (
3536 _database . SelfLink ,
You can’t perform that action at this time.
0 commit comments