close
The Wayback Machine - https://web.archive.org/web/20210801233858/https://github.com/kgrzybek/modular-monolith-with-ddd/issues/197
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

Wrong comparison operator #197

Open
aalmuqahwi opened this issue Apr 23, 2021 · 1 comment
Open

Wrong comparison operator #197

aalmuqahwi opened this issue Apr 23, 2021 · 1 comment

Comments

@aalmuqahwi
Copy link

@aalmuqahwi aalmuqahwi commented Apr 23, 2021

using CompanyName.MyMeetings.BuildingBlocks.Domain;
namespace CompanyName.MyMeetings.Modules.Meetings.Domain.Meetings.Rules
{
public class MeetingAttendeesLimitMustBeGreaterThanGuestsLimitRule : IBusinessRule
{
private readonly int? _attendeesLimit;
private readonly int _guestsLimit;
public MeetingAttendeesLimitMustBeGreaterThanGuestsLimitRule(int? attendeesLimit, int guestsLimit)
{
_attendeesLimit = attendeesLimit;
_guestsLimit = guestsLimit;
}
public bool IsBroken() => _attendeesLimit.HasValue && _attendeesLimit.Value < _guestsLimit;
public string Message => "Attendees limit must be greater than guests limit";
}
}

I believe the comparison operator used in the IsBroken method is wrong because the rule is checking that meeting attendees limit must be greater than guests limit.

@kgrzybek
Copy link
Owner

@kgrzybek kgrzybek commented Jun 8, 2021

Thanks @aalmuqahwi , agreed

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

Successfully merging a pull request may close this issue.

None yet
2 participants