From 69584e6c919adbeb1aaacb7aff7c7d8bddbf517d Mon Sep 17 00:00:00 2001 From: Vijay Uppu <913468@dadeschools.net> Date: Wed, 22 Nov 2023 16:40:23 -0500 Subject: [PATCH] fixed attachment test case issues --- .../AttachmentsServiceTest.cs | 30 +++++++++---------- .../appsettings.json | 2 +- .../appsettings.json | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/DamageAssesmentApi/DamageAssesment.Api.Attachments.Test/AttachmentsServiceTest.cs b/DamageAssesmentApi/DamageAssesment.Api.Attachments.Test/AttachmentsServiceTest.cs index 8dd9ba8..e816be5 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Attachments.Test/AttachmentsServiceTest.cs +++ b/DamageAssesmentApi/DamageAssesment.Api.Attachments.Test/AttachmentsServiceTest.cs @@ -33,7 +33,7 @@ namespace DamageAssesment.Api.Attachments.Test public async Task GetAttachmentsAsync_ShouldReturnStatusCode204() { var mockAttachmentService = new Mock(); - var mockUploadService = new Mock(); + var mockUploadService = new Mock(); var mockResponse = await MockData.getNoContentResponse(); mockAttachmentService.Setup(service => service.GetAttachmentsAsync()).ReturnsAsync(mockResponse); @@ -47,7 +47,7 @@ namespace DamageAssesment.Api.Attachments.Test public async Task GetAttachmentAsync_ShouldReturnStatusCode200() { var mockAttachmentService = new Mock(); - var mockUploadService = new Mock(); + var mockUploadService = new Mock(); var mockResponse = await MockData.getOkResponse(1); mockAttachmentService.Setup(service => service.GetAttachmentByIdAsync(1)).ReturnsAsync(mockResponse); @@ -61,7 +61,7 @@ namespace DamageAssesment.Api.Attachments.Test public async Task GetAttachmentAsync_ShouldReturnStatusCode404() { var mockAttachmentService = new Mock(); - var mockUploadService = new Mock(); + var mockUploadService = new Mock(); var mockResponse = await MockData.getNotFoundResponse(); mockAttachmentService.Setup(service => service.GetAttachmentByIdAsync(99)).ReturnsAsync(mockResponse); var AttachmentProvider = new AttachmentsController(mockAttachmentService.Object, mockUploadService.Object); @@ -73,14 +73,14 @@ namespace DamageAssesment.Api.Attachments.Test public async Task PostAttachmentAsync_ShouldReturnStatusCode200() { var mockAttachmentService = new Mock(); - var mockUploadService = new Mock(); + var mockUploadService = new Mock(); var mockResponse = await MockData.getOkResponse(); var AttachmentResponse = await MockData.GetAttachmentInfo(0); var mockInputAttachment = await MockData.getInputAttachmentData(); mockAttachmentService.Setup(service => service.PostAttachmentAsync(mockInputAttachment)).ReturnsAsync(mockResponse); - var AttachmentProvider = new AttachmentsController(mockAttachmentService.Object, mockUploadService.Object); - var result = (NoContentResult) await AttachmentProvider.UploadAttachmentAsync(AttachmentResponse); + var AttachmentProvider = new AttachmentsController(mockAttachmentService.Object, mockUploadService.Object); + var result = (NoContentResult)await AttachmentProvider.UploadAttachmentAsync(AttachmentResponse); Assert.Equal(204, result.StatusCode); } @@ -89,14 +89,14 @@ namespace DamageAssesment.Api.Attachments.Test public async Task PostAttachmentAsync_ShouldReturnStatusCode400() { var mockAttachmentService = new Mock(); - var mockUploadService = new Mock(); + var mockUploadService = new Mock(); var mockInputAttachment = await MockData.getInputAttachmentData(); var mockResponse = await MockData.getBadRequestResponse(); mockAttachmentService.Setup(service => service.PostAttachmentAsync(mockInputAttachment)).ReturnsAsync(mockResponse); var AttachmentProvider = new AttachmentsController(mockAttachmentService.Object, mockUploadService.Object); - AttachmentInfo attachmentInfo=new AttachmentInfo(); - var result = (BadRequestObjectResult) await AttachmentProvider.UploadAttachmentAsync(attachmentInfo); + AttachmentInfo attachmentInfo = new AttachmentInfo(); + var result = (BadRequestObjectResult)await AttachmentProvider.UploadAttachmentAsync(attachmentInfo); Assert.Equal(400, result.StatusCode); } @@ -105,14 +105,14 @@ namespace DamageAssesment.Api.Attachments.Test public async Task PutAttachmentAsync_ShouldReturnStatusCode200() { var mockAttachmentService = new Mock(); - var mockUploadService = new Mock(); + var mockUploadService = new Mock(); var mockResponse = await MockData.getOkResponse(); var AttachmentResponse = await MockData.GetAttachmentInfo(1); var mockInputAttachment = await MockData.getInputAttachmentData(); mockAttachmentService.Setup(service => service.PostAttachmentAsync(mockInputAttachment)).ReturnsAsync(mockResponse); var AttachmentProvider = new AttachmentsController(mockAttachmentService.Object, mockUploadService.Object); - var result = (NoContentResult) await AttachmentProvider.UpdateAttachmentAsync(AttachmentResponse); + var result = (NoContentResult)await AttachmentProvider.UpdateAttachmentAsync(AttachmentResponse); Assert.Equal(204, result.StatusCode); } @@ -121,14 +121,14 @@ namespace DamageAssesment.Api.Attachments.Test public async Task PutAttachmentAsync_ShouldReturnStatusCode400() { var mockAttachmentService = new Mock(); - var mockUploadService = new Mock(); + var mockUploadService = new Mock(); var mockInputAttachment = await MockData.getInputAttachmentData(); var mockResponse = await MockData.getBadRequestResponse(); mockAttachmentService.Setup(service => service.PostAttachmentAsync(mockInputAttachment)).ReturnsAsync(mockResponse); var AttachmentProvider = new AttachmentsController(mockAttachmentService.Object, mockUploadService.Object); AttachmentInfo attachmentInfo = new AttachmentInfo(); - var result = (BadRequestObjectResult) await AttachmentProvider.UpdateAttachmentAsync(attachmentInfo); + var result = (BadRequestObjectResult)await AttachmentProvider.UpdateAttachmentAsync(attachmentInfo); Assert.Equal(400, result.StatusCode); } @@ -136,7 +136,7 @@ namespace DamageAssesment.Api.Attachments.Test public async Task DeleteAttachmentAsync_ShouldReturnStatusCode200() { var mockAttachmentService = new Mock(); - var mockUploadService = new Mock(); + var mockUploadService = new Mock(); var mockResponse = await MockData.getOkResponse(1); mockAttachmentService.Setup(service => service.DeleteAttachmentAsync(1)).ReturnsAsync(mockResponse); mockUploadService.Setup(service => service.Deletefile("")); @@ -150,7 +150,7 @@ namespace DamageAssesment.Api.Attachments.Test public async Task DeleteAttachmentAsync_ShouldReturnStatusCode404() { var mockAttachmentService = new Mock(); - var mockUploadService = new Mock(); + var mockUploadService = new Mock(); var mockResponse = await MockData.getNotFoundResponse(); mockAttachmentService.Setup(service => service.DeleteAttachmentAsync(1)).ReturnsAsync(mockResponse); var AttachmentProvider = new AttachmentsController(mockAttachmentService.Object, mockUploadService.Object); diff --git a/DamageAssesmentApi/DamageAssesment.Api.Employees/appsettings.json b/DamageAssesmentApi/DamageAssesment.Api.Employees/appsettings.json index 377f7e4..4d62bd3 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Employees/appsettings.json +++ b/DamageAssesmentApi/DamageAssesment.Api.Employees/appsettings.json @@ -11,7 +11,7 @@ "AllowedHosts": "*", "ConnectionStrings": { //"EmployeeConnection": "Server=DESKTOP-OF5DPLQ\\SQLEXPRESS;Database=da_survey_dev;Trusted_Connection=True;TrustServerCertificate=True;" - "EmployeeConnection": "Server=tcp:da-dev.database.windows.net,1433;Initial Catalog=da-dev-db;Encrypt=True;User ID=admin-dev;Password=b3tgRABw8LGE75k;TrustServerCertificate=False;Connection Timeout=30;" + "EmployeeConnection": "Server=207.180.248.35;Database=da_survey_dev;User Id=sa;Password=YourStrongPassw0rd;TrustServerCertificate=True;" } } diff --git a/DamageAssesmentApi/DamageAssesment.Api.Questions/appsettings.json b/DamageAssesmentApi/DamageAssesment.Api.Questions/appsettings.json index 3aa83a2..22e1c7d 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Questions/appsettings.json +++ b/DamageAssesmentApi/DamageAssesment.Api.Questions/appsettings.json @@ -11,7 +11,7 @@ "AllowedHosts": "*", "ConnectionStrings": { //"QuestionConnection": "Server=DESKTOP-OF5DPLQ\\SQLEXPRESS;Database=da_survey_dev;Trusted_Connection=True;TrustServerCertificate=True;" - "QuestionConnection": "Server=tcp:da-dev.database.windows.net,1433;Initial Catalog=da-dev-db;Encrypt=True;User ID=admin-dev;Password=b3tgRABw8LGE75k;TrustServerCertificate=False;Connection Timeout=30;" + "QuestionConnection": "Server=207.180.248.35;Database=da_survey_dev;User Id=sa;Password=YourStrongPassw0rd;TrustServerCertificate=True;" } }