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
describe("Suite to test the glossary API", () => { | |
const uuidv1 = require('uuid/v1'); | |
const https = require('https'); | |
const httpsAgent = new https.Agent({ rejectUnauthorized: false }); | |
const axios = require('axios'); | |
const host = process.env.API_HOST || "localhost"; | |
const baseUrl = `http://${host}:5000/api`; | |
console.log(`BaseURL: ${baseUrl}`); | |
const client = axios.create({ | |
baseURL: baseUrl, |
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
const axios = require('axios'); | |
var Config = require('config-js'); | |
var config = new Config('./config/config.js'); | |
module.exports = { | |
getToken: async () => { | |
const url = config.get("auth0.url"); | |
const body = { | |
client_id: config.get("auth0.client_id"), | |
client_secret: config.get("auth0.client_secret"), |
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
[Fact] | |
public async Task should_delete_glossary_item() | |
{ | |
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); | |
var response = await client.DeleteAsync("glossary/openid"); | |
Assert.Equal(HttpStatusCode.NoContent, response.StatusCode); | |
} |
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.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json; | |
using api; | |
using Xunit; | |
namespace tests | |
{ | |
public class GlossaryControllerTests : ControllerTestsBase |
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.Http; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using System.Text.Json; | |
using Microsoft.Extensions.Configuration; | |
using Xunit; | |
namespace tests | |
{ |
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
describe("Suite to test the glossary API", () => { | |
const https = require('https'); | |
const httpsAgent = new https.Agent({ rejectUnauthorized: false }); | |
const axios = require('axios'); | |
const baseUrl = `https://localhost:5001/api`; | |
const client = axios.create({ | |
baseURL: baseUrl, | |
httpsAgent | |
}) |
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
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddAuthentication(options => | |
{ | |
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; | |
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; | |
}).AddJwtBearer(options => | |
{ | |
options.Authority = $"https://{Configuration["Auth0:Domain"]}/"; | |
options.Audience = Configuration["Auth0:Audience"]; |
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.Text.Json; | |
using System.Threading.Tasks; | |
using api; | |
using Xunit; | |
namespace tests | |
{ |
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 exec \ | |
-i 0dbf706877a9bb59911178ce01ff0786cdd1addb0219cb0417bb1781b903e3ee \ | |
/bin/sh -c "if PID=$(pidof dotnet); then kill $PID; fi" |
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 run -dt \ | |
-v "C:\Users\gnsch\vsdbg\vs2017u5:/remote_debugger:rw" \ | |
-v "C:\Users\gnsch\source\repos\WebApplication1\WebApplication1:/app" \ | |
-v "C:\Users\gnsch\source\repos\WebApplication1:/src" \ | |
-v "C:\Users\gnsch\AppData\Roaming\Microsoft\UserSecrets:/root/.microsoft/usersecrets:ro" \ | |
-v "C:\Users\gnsch\AppData\Roaming\ASP.NET\Https:/root/.aspnet/https:ro" \ | |
-v "C:\Users\gnsch\.nuget\packages\:/root/.nuget/fallbackpackages2" \ | |
-v "C:\Program Files\dotnet\sdk\NuGetFallbackFolder:/root/.nuget/fallbackpackages" \ | |
-e "DOTNET_USE_POLLING_FILE_WATCHER=1" \ | |
-e "ASPNETCORE_ENVIRONMENT=Development" \ |
NewerOlder