Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kalillamont
Copy link

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.

…to GetSpecialDays function. Fix for related Resources test that was pulling back incorrect Holy Day previously. Added new YearInfo test to check bugfix.
Copy link
Collaborator

@benrobot benrobot left a 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.

Comment on lines +107 to +117
[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);
}
Copy link
Collaborator

@benrobot benrobot Feb 5, 2021

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.

Copy link
Collaborator

@benrobot benrobot Feb 5, 2021

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

Copy link
Owner

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants