-
Notifications
You must be signed in to change notification settings - Fork 3
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
Holy Days Issue Bugfix #5
base: master
Are you sure you want to change the base?
Conversation
…to GetSpecialDays function. Fix for related Resources test that was pulling back incorrect Holy Day previously. Added new YearInfo test to check bugfix.
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.
Make sure to reference the associated issue from the description of the pull request.
[Fact] | ||
public void GetSpecialDays_HolyDaysWanted() | ||
{ | ||
var yearInfo = new BadiYearInfo(174); | ||
|
||
var specialDaysList = yearInfo.GetSpecialDays(SpecialDayType.HolyDay_WorkSuspended, HolyDayCode.NawRuz); | ||
specialDaysList.Count().ShouldEqual(1); | ||
|
||
specialDaysList = yearInfo.GetSpecialDays(SpecialDayType.HolyDay_WorkSuspended, HolyDayCode.Ridvan1); | ||
specialDaysList.Count().ShouldEqual(1); | ||
} |
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.
In addition to asserting the count the test should also assert the correct day and day code are returned.
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.
You can also change this test from a Fact to a Theory and exhaustively test every possible HolyDayCode
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.
In just reading the code change proposed, I can't be confident that it is working fully. I'd need to run the code and do a number of other tests to be sure.
So it would be good if you could add more tests and made them more comprehensive. For instance, it would be good to also test calls that will give no result, like .GetSpecialDays(SpecialDayType.HolyDay_Other, HolyDayCode.Ridvan1)
.
Fix for specific Holy Day not getting pulled back when code provided to GetSpecialDays function. HasFlags() check was previously failing, replaced with not-null check instead.
Fix for related Resources test that was pulling back incorrect Holy Day previously. Special Day code was passed incorrectly for Birth of the Bab test case.
Added new YearInfo test to check bugfix.