public void IsFlagSet_DoesntContainFlagSuccessfully() { FlagEnumTest testEnum = (FlagEnumTest.FlagThree | FlagEnumTest.FlagTwo); Assert.IsFalse(testEnum.IsFlagSet(FlagEnumTest.FlagOne)); Assert.IsFalse(testEnum.IsFlagSet(FlagEnumTest.FlagFour)); }
public void IsFlagSet_ContainsFlagSuccessfully() { FlagEnumTest testEnum = (FlagEnumTest.FlagThree | FlagEnumTest.FlagTwo); // Asserts Assert.IsTrue(testEnum.IsFlagSet(FlagEnumTest.FlagTwo)); Assert.IsTrue(testEnum.IsFlagSet(FlagEnumTest.FlagThree)); Assert.IsTrue(testEnum.IsFlagSet((FlagEnumTest.FlagTwo | FlagEnumTest.FlagThree))); }
public void IsFlagSet_ThrowsExceptionOnFlagValueZero() { FlagEnumTest testEnum = (FlagEnumTest.FlagThree | FlagEnumTest.FlagTwo); Assert.ThrowsException <ArgumentOutOfRangeException>(() => testEnum.IsFlagSet(FlagEnumTest.Invalid)); }