version: 1.0.{build}
image: Visual Studio 2017
build_script:
- ps: >-
    dotnet restore;
    dotnet build -c Release;
test_script:
- ps: >-
    curl https://dl.bintray.com/apache/couchdb/win/2.0.0.1/apache-couchdb-2.0.0.1.msi -UseBasicParsing -outfile couchdb.msi;
    install-package -providername msi ./couchdb.msi;

    $couchOutput = curl http://localhost:5984 -UseBasicParsing;
    
    if ($couchOutput.StatusCode -ne 200) {
        echo $couchOutput;
        throw "CouchDB did not return a 200 OK status code. Did it fail to install?";
    }

    $output = dotnet test Davenport.Tests/Davenport.Tests.csproj -c Release;

    echo $output;

    if ($output -contains "Test Run Failed.") {
        echo "Last output code was $LastExitCode";
       throw "Test failed. Review output.";
    }
version: 1.0.{build}
image: Visual Studio 2017
build_script:
- ps: >-
    dotnet restore;
    dotnet build -c Release;
test_script:
- ps: >-
    curl https://dl.bintray.com/apache/couchdb/win/2.0.0.1/apache-couchdb-2.0.0.1.msi -UseBasicParsing -outfile couchdb.msi;
    install-package -providername msi ./couchdb.msi;

    $couchOutput = curl http://localhost:5984 -UseBasicParsing;
    
    if ($couchOutput.StatusCode -ne 200) {
        echo $couchOutput;
        throw "CouchDB did not return a 200 OK status code. Did it fail to install?";
    }

    $output = dotnet test Davenport.Tests/Davenport.Tests.csproj -c Release;

    echo $output;

    if ($LastExitCode -eq 0 -or $output -contains "Test Run Failed.") {
        echo "Last output code was $LastExitCode";
        throw "Test failed. Review output.";
    }
Check LastExitCode when tests finish.
Check LastExitCode when tests finish.
