public async Task Build_HttpsEverywhereFalse_Successful() { using (var tempDirectory = TemplateAssert.GetTempDirectory()) { var project = await tempDirectory.DotnetNew( "graphql", "HttpsEverywhereFalse", new Dictionary <string, string>() { { "https-everywhere", "false" }, }); await project.DotnetRestore(); await project.DotnetBuild(); await project.DotnetRun( async (httpClient, httpsClient) => { var httpResponse = await httpClient.GetAsync("/"); httpResponse.EnsureSuccessStatusCode(); var httpsResponse = await httpsClient.GetAsync("/"); httpsResponse.EnsureSuccessStatusCode(); }); } }
public async Task Build_HttpsEverywhereFalse_Successful() { using (var tempDirectory = TemplateAssert.GetTempDirectory()) { var project = await tempDirectory.DotnetNew( "api", "HttpsEverywhereFalse", new Dictionary <string, string>() { { "https-everywhere", "false" }, }); await project.DotnetRestore(); await project.DotnetBuild(); await project.DotnetRun( async() => { var httpResponse = await this.HttpClient.GetAsync("http://localhost:5000/status"); httpResponse.EnsureSuccessStatusCode(); var httpsResponse = await this.HttpClient.GetAsync("https://localhost:5001/status"); httpsResponse.EnsureSuccessStatusCode(); }); } }
public async Task Build_HttpsEverywhereFalse_Successful() { using (var tempDirectory = TemplateAssert.GetTempDirectory()) { var project = await tempDirectory.DotnetNew( "api", "HttpsEverywhereFalse", new Dictionary <string, string>() { { "HttpsEverywhere", "false" }, }); await project.DotnetRestore(); await project.DotnetBuild(); // await project.DotnetRun( // async () => // { // var response = await this.HttpClient.GetAsync("http://localhost:5000/status"); // response.EnsureSuccessStatusCode(); // await Assert.ThrowsAsync<HttpRequestException>( // () => this.HttpClient.GetAsync("https://localhost:44300/status")); // }); } }
public async Task Run_Default_Successful() { using (var tempDirectory = TemplateAssert.GetTempDirectory()) { var project = await tempDirectory.DotnetNew("graphql", "Default"); await project.DotnetRun( async (httpClient, httpsClient) => { var httpResponse = await httpClient.GetAsync("/"); Assert.Equal(HttpStatusCode.OK, httpResponse.StatusCode); var httpsResponse = await httpsClient.GetAsync("/"); Assert.Equal(HttpStatusCode.OK, httpResponse.StatusCode); var robotsTxtResponse = await httpsClient.GetAsync("robots.txt"); Assert.Equal(HttpStatusCode.OK, robotsTxtResponse.StatusCode); var securityTxtResponse = await httpsClient.GetAsync(".well-known/security.txt"); Assert.Equal(HttpStatusCode.OK, securityTxtResponse.StatusCode); var humansTxtResponse = await httpsClient.GetAsync("humans.txt"); Assert.Equal(HttpStatusCode.OK, humansTxtResponse.StatusCode); }); } }
public async Task RestoreAndBuild_Default_Successful(string name, params string[] arguments) { using (var tempDirectory = TemplateAssert.GetTempDirectory()) { var dictionary = arguments .Select(x => x.Split('=', StringSplitOptions.RemoveEmptyEntries)) .ToDictionary(x => x.First(), x => x.Last()); var project = await tempDirectory.DotnetNew("graphql", name, dictionary); await project.DotnetRestore(); await project.DotnetBuild(); } }
public async Task Run_Default_Successful() { using (var tempDirectory = TemplateAssert.GetTempDirectory()) { var project = await tempDirectory.DotnetNew("graphql", "Default"); await project.DotnetRun( async (httpClient, httpsClient) => { var httpResponse = await httpClient.GetAsync("/"); Assert.Equal(HttpStatusCode.OK, httpResponse.StatusCode); var httpsResponse = await httpsClient.GetAsync("/"); Assert.Equal(HttpStatusCode.OK, httpResponse.StatusCode); }); } }
public async Task Build_Default_Successful() { using (var tempDirectory = TemplateAssert.GetTempDirectory()) { var project = await tempDirectory.DotnetNew("graphql", "Default"); await project.DotnetRestore(); await project.DotnetBuild(); await project.DotnetRun( async (httpClient, httpsClient) => { var httpResponse = await httpClient.GetAsync("/"); httpResponse.EnsureSuccessStatusCode(); var httpsResponse = await httpsClient.GetAsync("/"); httpsResponse.EnsureSuccessStatusCode(); }); } }
public async Task Build_Default_Successful() { using (var tempDirectory = TemplateAssert.GetTempDirectory()) { var project = await tempDirectory.DotnetNew("api", "Default"); await project.DotnetRestore(); await project.DotnetBuild(); await project.DotnetRun( async() => { var httpResponse = await this.HttpClient.GetAsync("http://localhost:5000/status"); httpResponse.EnsureSuccessStatusCode(); var httpsResponse = await this.HttpClient.GetAsync("https://localhost:5001/status"); httpsResponse.EnsureSuccessStatusCode(); }); } }
public async Task Run_HttpsEverywhereFalse_Successful() { using (var tempDirectory = TemplateAssert.GetTempDirectory()) { var project = await tempDirectory.DotnetNew( "graphql", "HttpsEverywhereFalse", new Dictionary <string, string>() { { "https-everywhere", "false" }, }); await project.DotnetRun( async (httpClient) => { var httpResponse = await httpClient.GetAsync("/"); Assert.Equal(HttpStatusCode.OK, httpResponse.StatusCode); }); } }
public async Task Run_SwaggerFalse_Successful() { using (var tempDirectory = TemplateAssert.GetTempDirectory()) { var project = await tempDirectory.DotnetNew( "api", "SwaggerFalse", new Dictionary <string, string>() { { "swagger", "false" }, }); await project.DotnetRun( async (httpClient, httpsClient) => { var swaggerJsonResponse = await httpsClient.GetAsync("swagger/v1/swagger.json"); Assert.Equal(HttpStatusCode.NotFound, swaggerJsonResponse.StatusCode); }); } }
public async Task Run_Default_Successful() { using (var tempDirectory = TemplateAssert.GetTempDirectory()) { var project = await tempDirectory.DotnetNew("api", "Default"); await project.DotnetRun( async (httpClient, httpsClient) => { var httpResponse = await httpClient.GetAsync("status"); Assert.Equal(HttpStatusCode.NoContent, httpResponse.StatusCode); var httpsResponse = await httpsClient.GetAsync("status"); Assert.Equal(HttpStatusCode.NoContent, httpsResponse.StatusCode); var swaggerJsonResponse = await httpsClient.GetAsync("swagger/v1/swagger.json"); Assert.Equal(HttpStatusCode.OK, swaggerJsonResponse.StatusCode); }); } }
public async Task Build_Default_Successful() { using (var tempDirectory = TemplateAssert.GetTempDirectory()) { var project = await tempDirectory.DotnetNew("graphql", "Default"); await project.DotnetRestore(); await project.DotnetBuild(); // await project.DotnetRun( // async () => // { // await Assert.ThrowsAsync<HttpRequestException>( // () => this.HttpClient.GetAsync("http://localhost:5000/status")); // var response = await this.HttpClient.GetAsync("https://localhost:44300/status"); // response.EnsureSuccessStatusCode(); // }); } }