Skip to content

Commit

Permalink
Fixed failed nunit test (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshakirdfe authored Dec 6, 2024
1 parent 94ce10a commit 000ff4b
Showing 1 changed file with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -92,17 +93,32 @@ public async Task ParametersValid___ApplicationCreated()
id,
applicationCreateRequestModel.ApplicationType,
ApplicationStatus.InProgress,
new List<ApplicationContributorServiceModel> { new ApplicationContributorServiceModel(
[ new ApplicationContributorServiceModel(
actualContributor.ContributorId,
applicationCreateRequestModel.Contributor.FirstName,
applicationCreateRequestModel.Contributor.LastName,
applicationCreateRequestModel.Contributor.EmailAddress,
applicationCreateRequestModel.Contributor.Role,
applicationCreateRequestModel.Contributor.OtherRoleName) },
new List<ApplicationSchoolServiceModel>(),
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]
Expand Down

0 comments on commit 000ff4b

Please sign in to comment.