-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get cash import by date Entity Framework rewrite #155
base: development
Are you sure you want to change the base?
Conversation
* Add SSMiniTransaction entity * Stub test * Improve setup * SSmini DB setup * Working test case * Pull out duplicate data gen * Unneeded warning suppression * Format * Cleanup * Check for suspense transactions * Cleanup * format * Rename * Extract var * Remove brackets
@@ -39,7 +39,7 @@ dotnet_naming_symbols.public_symbols.applicable_accessibilities = public | |||
|
|||
#Parameters should be camel case | |||
dotnet_naming_style.camel_case_style.capitalization = camel_case | |||
dotnet_naming_rule.local_objects_must_be_camel_case.severity = error | |||
dotnet_naming_rule.local_objects_must_be_camel_case.severity = suggestion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We consistently don't follow this rule, so it just gets in the way
@@ -136,3 +136,6 @@ dotnet_diagnostic.CA1001.severity = none | |||
|
|||
#Can reassign collections | |||
dotnet_diagnostic.CA2227.severity = none | |||
|
|||
# No need to mark CLSCompliant | |||
dotnet_diagnostic.CA1014.severity = none |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't something we've been following so this suppresses the warnings
@@ -552,95 +552,6 @@ await _classUnderTest | |||
} | |||
#endregion | |||
|
|||
#region Cash Import |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are redundant now because we're no longer calling this method for this report - there's nothing to mock and the new test runs directly against the Dockerised db
* with the total value of transactions for each rent group | ||
* with summed totals across all rent groups | ||
*/ | ||
|
||
[Fact] | ||
public async void ShouldGetCashImportByDate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expanded this test to insert multiple records and ensure that they were being grouped and aggregated correctly
@@ -63,5 +64,31 @@ public interface IDatabaseContext | |||
Task<List<string[]>> GetItemisedTransactionsByYearAndTransactionTypeAsync(int year, string transactionType); | |||
Task<List<string[]>> GetHousingBenefitAcademyByYear(int year); | |||
Task<IList<string[]>> GetReportAccountBalance(DateTime reportDate, string rentGroup); | |||
|
|||
public DbSet<BatchLog> BatchLogs { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These weren't in the interface and so didn't allow access in the tests - added these for current and future convenience
@@ -41,7 +41,7 @@ public async Task ShouldLoadHousingFilesAndReturnStepResponse() | |||
|
|||
// Assert | |||
result.Continue.Should().BeTrue(); | |||
result.NextStepTime.Should().BeCloseTo(DateTime.Now.AddSeconds(_waitDuration)); | |||
result.NextStepTime.Should().BeCloseTo(DateTime.Now.AddSeconds(_waitDuration), 500); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was flaky on CircleCI
Tests for this process, rewritten in Entity Framework.
Runs on the EE Docker environment (make unit_db_ee)
See sproc code: https://github.com/LBHackney-IT/HFSDatabaseObjects/blob/880959d860c087cde6f946f16834e8f5b2416c0a/stored_procedures/usp_GetCashImportByDate.sql
What the stored procedure does is:
The test works the same with the original stored procedure SQL and the new entity framework code