ShouldHaveFlag
allows you to assert whether an object is an enum and has a flag specified.
Conversely ShouldNotHaveFlag
allows you to assert the opposite; that an object is an enum but does not have a flag specified.
var actual = TestEnum.FlagTwo;var value = TestEnum.FlagOne;actual.ShouldHaveFlag(value);
Exception
actualshould have flagTestEnum.FlagOnebut hadTestEnum.FlagTwo
var actual = TestEnum.FlagOne;var value = TestEnum.FlagOne;actual.ShouldNotHaveFlag(value);
Exception
actualshould not have flagTestEnum.FlagOnebut it hadTestEnum.FlagOne