From 000ff4bf113531dfe2145cad87d4026cf0cea710 Mon Sep 17 00:00:00 2001 From: mshakirdfe Date: Fri, 6 Dec 2024 14:40:20 +0000 Subject: [PATCH] Fixed failed nunit test (#620) --- .../ApplicationCreateTests.cs | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/Dfe.Academies.Academisation.SubcutaneousTest/ApplicationAggregate/ApplicationCreateTests.cs b/Dfe.Academies.Academisation.SubcutaneousTest/ApplicationAggregate/ApplicationCreateTests.cs index 37dd521d7..bdb6c3640 100644 --- a/Dfe.Academies.Academisation.SubcutaneousTest/ApplicationAggregate/ApplicationCreateTests.cs +++ b/Dfe.Academies.Academisation.SubcutaneousTest/ApplicationAggregate/ApplicationCreateTests.cs @@ -15,6 +15,7 @@ using Dfe.Academies.Academisation.Service.Commands.Application; using Dfe.Academies.Academisation.Service.Queries; using Dfe.Academies.Academisation.WebApi.Controllers; +using DocumentFormat.OpenXml.Spreadsheet; using MediatR; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -92,17 +93,32 @@ public async Task ParametersValid___ApplicationCreated() id, applicationCreateRequestModel.ApplicationType, ApplicationStatus.InProgress, - new List { new ApplicationContributorServiceModel( + [ new ApplicationContributorServiceModel( actualContributor.ContributorId, applicationCreateRequestModel.Contributor.FirstName, applicationCreateRequestModel.Contributor.LastName, applicationCreateRequestModel.Contributor.EmailAddress, applicationCreateRequestModel.Contributor.Role, - applicationCreateRequestModel.Contributor.OtherRoleName) }, - new List(), - null, null, null, id.ToString(), actualApplication.EntityId, null, null); - - Assert.Equivalent(expectedApplication, actualApplication); + applicationCreateRequestModel.Contributor.OtherRoleName) ], + [], + null, null, null, id.ToString(), actualApplication.EntityId, null, DateTime.UtcNow); + + Assert.Equal(expectedApplication.ApplicationType, actualApplication.ApplicationType); + foreach (var (contributor, index) in actualApplication.Contributors.Select((value, i) => (value, i))) + { + Assert.Equal(contributor.FirstName, actualContributor.FirstName); + Assert.Equal(contributor.LastName, actualContributor.LastName); + Assert.Equal(contributor.EmailAddress, actualContributor.EmailAddress); + Assert.Equal(contributor.Role, actualContributor.Role); + Assert.Equal(contributor.OtherRoleName, actualContributor.OtherRoleName); + } + Assert.Null(expectedApplication.DeletedAt); + Assert.NotNull(expectedApplication.CreatedOn); + Assert.Equal(expectedApplication.ApplicationSubmittedDate, actualApplication.ApplicationSubmittedDate); + Assert.Equal(expectedApplication.ApplicationStatus, actualApplication.ApplicationStatus); + Assert.Equivalent(expectedApplication.joinTrustDetails, actualApplication.joinTrustDetails); + Assert.Equivalent(expectedApplication.formTrustDetails, actualApplication.formTrustDetails); + Assert.Equivalent(expectedApplication.Schools, actualApplication.Schools); } [Fact]