Beispiel #1
0
 public void TranslateToUseCaseScenarioWithInvalidRequestContentUsingHttpServerTest()
 {
     using (var server = ControllerTestUtilities.CreateTestHttpServer()) {
         using (var client = new HttpClient(server)) {
             using (var response = client.SendAsync(CreateUseCaseScenarioRequest(new ByteArrayContent(new byte[0]))).Result) {
                 Assert.IsTrue(response.StatusCode == HttpStatusCode.UnsupportedMediaType);
             }
         }
     }
 }
Beispiel #2
0
 public void TranslateToUseCaseScenarioUsingHttpServerTest()
 {
     using (var server = ControllerTestUtilities.CreateTestHttpServer()) {
         using (var client = new HttpClient(server)) {
             using (var response = client.SendAsync(CreateUseCaseScenarioRequest(CreateUseCaseContent())).Result) {
                 AssertTranslateToUseCaseScenarioResponse(response);
             }
         }
     }
 }
Beispiel #3
0
 public void GetTestSuiteExcelTemplateUsingHttpServerTest()
 {
     using (var server = ControllerTestUtilities.CreateTestHttpServer()) {
         using (var client = new HttpClient(server)) {
             using (var response = client.SendAsync(ControllerTestUtilities.CreateRequest("templates/test-suite/excel", HttpMethod.Get, null)).Result) {
                 Assert.IsTrue(response.StatusCode == HttpStatusCode.OK);
                 Assert.IsTrue(response.Content.Headers.ContentType.MediaType == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
                 Assert.IsTrue(response.Content.Headers.ContentDisposition.DispositionType == "attachment");
                 Assert.IsTrue(response.Content.Headers.ContentDisposition.FileName == "TestSuiteTemplate.xlsx");
             }
         }
     }
 }
Beispiel #4
0
 public void GetUseCaseScenarioSetTemplateUsingHttpServerTest()
 {
     using (var server = ControllerTestUtilities.CreateTestHttpServer()) {
         using (var client = new HttpClient(server)) {
             using (var response = client.SendAsync(ControllerTestUtilities.CreateRequest("templates/use-case/scenario-set", HttpMethod.Get, null)).Result) {
                 Assert.IsTrue(response.StatusCode == HttpStatusCode.OK);
                 Assert.IsTrue(response.Content.Headers.ContentType.MediaType == "text/plain");
                 Assert.IsTrue(response.Content.Headers.ContentType.CharSet == "utf-8");
                 Assert.IsTrue(response.Content.Headers.ContentDisposition.DispositionType == "attachment");
                 Assert.IsTrue(response.Content.Headers.ContentDisposition.FileName == "UseCaseScenarioSetTemplate.md");
             }
         }
     }
 }