Skip to content

Commit

Permalink
TECH-3764 Fix issues with unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AliArmanLMG committed Sep 17, 2024
1 parent 148139c commit e128164
Showing 1 changed file with 6 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,7 @@ public LixiPackageServiceTests()
// Create an instance of LixiPackageService
_sut = new LixiPackageService();
}

[Fact]
public async Task CreatePackageAsync_ShouldSetCorrectValues()
{
// Arrange
var lodgementInformation = new SampleLodgementInformation
{
LoanId = 12345,
Scenario = LoanApplicationScenario.NewLoanApplication
};

var package = new Package
{
ProductionData = true,
Content = new PackageContent
{
Application = new Application
{
Overview = new Overview(),
UniqueID = ""
}
}
};


// Act
var result = await _sut.CreatePackageAsync(lodgementInformation);

// Assert
Assert.False(result.ProductionData);
Assert.Equal(lodgementInformation.LoanId.ToString(), result.Content.Application.Overview.BrokerApplicationReferenceNumber);
Assert.Equal($"LoanScenario-{lodgementInformation.LoanId}", result.Content.Application.UniqueID);
}


[Fact]
public async Task GetPackageAsync_ShouldReturnPackageFromFile()
Expand Down Expand Up @@ -81,6 +49,9 @@ public async Task GetPackageAsync_ShouldReturnPackageFromFile()
// Assert
Assert.NotNull(result);
Assert.Equal(packageContent.UniqueID, result.UniqueID);

// Clean up the file
File.Delete(packagePath);
}

[Fact]
Expand Down Expand Up @@ -115,5 +86,7 @@ public async Task SavePackageAsync_ShouldWritePackageToFile()

Assert.Equal(package.Content.Application.SalesChannel.Aggregator.CompanyName, savedPackage.Content.Application.SalesChannel.Aggregator.CompanyName);

// Clean up the file
File.Delete(packagePath);
}
}

0 comments on commit e128164

Please sign in to comment.