diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/ApplicationLinks/ApplicationLinksModal.cshtml.cs b/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/ApplicationLinks/ApplicationLinksModal.cshtml.cs index e02066efe..ff444e604 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/ApplicationLinks/ApplicationLinksModal.cshtml.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/ApplicationLinks/ApplicationLinksModal.cshtml.cs @@ -93,7 +93,6 @@ public async Task OnPostAsync() string[]? selectedApplicationsArray = JsonConvert.DeserializeObject(SelectedApplications); List? grantApplications = JsonConvert.DeserializeObject>(GrantApplicationsList!); List? linkedApplications = JsonConvert.DeserializeObject>(LinkedApplicationsList!); - List? applicationList = JsonConvert.DeserializeObject>(GrantApplicationsList!); foreach (var item in selectedApplicationsArray!) { diff --git a/applications/Unity.GrantManager/test/Unity.GrantManager.Web.Tests/Components/ApplicationLinksWidgetTests.cs b/applications/Unity.GrantManager/test/Unity.GrantManager.Web.Tests/Components/ApplicationLinksWidgetTests.cs deleted file mode 100644 index a7079bc0f..000000000 --- a/applications/Unity.GrantManager/test/Unity.GrantManager.Web.Tests/Components/ApplicationLinksWidgetTests.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc.Rendering; -using Microsoft.AspNetCore.Mvc.ViewComponents; -using NSubstitute; -using Shouldly; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Unity.GrantManager.GrantApplications; -using Unity.GrantManager.Web.Views.Shared.Components.ApplicationLinksWidget; -using Xunit; - -namespace Unity.GrantManager.Components -{ - public class ApplicationLinksWidgetTests : GrantManagerWebTestBase - { - [Fact] - public async Task ApplicationLinksWidgetReturnsStatus() - { - // Arrange - var applicationLinksService = Substitute.For(); - var applicationId = Guid.NewGuid(); - var expectedCategory = "Category"; - var expectedReferenceNumber = "ReferenceNumber"; - var expectedStatus = "Status"; - List applicationLinksInfoDtos = new List(); - applicationLinksInfoDtos.Add(new ApplicationLinksInfoDto() - { - ApplicationId = applicationId, - Category = expectedCategory, - ReferenceNumber = expectedReferenceNumber, - ApplicationStatus = expectedStatus - }); - var httpContext = new DefaultHttpContext(); - - applicationLinksService.GetListByApplicationAsync(applicationId).Returns(await Task.FromResult(applicationLinksInfoDtos)); - - var viewContext = new ViewContext - { - HttpContext = httpContext - }; - var viewComponentContext = new ViewComponentContext - { - ViewContext = viewContext - }; - - var viewComponent = new ApplicationLinksWidgetViewComponent(applicationLinksService) - { - ViewComponentContext = viewComponentContext - }; - - //Act - //This always gets a null result - var result = await viewComponent.InvokeAsync(applicationId) as ViewViewComponentResult; - ApplicationLinksWidgetViewModel? resultModel; - - resultModel = result!.ViewData!.Model! as ApplicationLinksWidgetViewModel; - - //Assert - //resultModel!.ApplicationLinks[0].Category.ShouldBe(expectedCategory); - //resultModel!.ApplicationLinks[0].ReferenceNumber.ShouldBe(expectedReferenceNumber); - //resultModel!.ApplicationLinks[0].ApplicationStatus.ShouldBe(expectedStatus); - } - } -}