public void SmartFlagEnumWithZeroValueReturnsValidValues() { var result = SmartFlagTestEnum.FromValue(3).ToList(); Assert.Equal("One", result[0].Name); Assert.Equal("Two", result[1].Name); }
public void ReturnsAllWhenGivenInputNegativeOne() { var result = SmartFlagTestEnum.FromValue(-1).ToList(); Assert.Equal(5, result.Count); Assert.Equal("One", result[0].Name); Assert.Equal("Two", result[1].Name); Assert.Equal("Three", result[2].Name); Assert.Equal("Four", result[3].Name); Assert.Equal("Five", result[4].Name); }
public void DoesNothingIfEnumValuesArePositive() { SmartFlagTestEnum.FromValue(3); }
public void DoesNothingIfEnumValuesArePowerOfTwo() { SmartFlagTestEnum.FromValue(3); }
public void ThrowsExceptionWhenEnumIsAboveAllowableRangeFromValue() { Assert.Throws <SmartEnumNotFoundException>(() => SmartFlagTestEnum.FromValue(32)); }
public void ZeroValueReturnsIEnumerableWithZeroValueEnum() { var result = SmartFlagTestEnum.FromValue(0).ToList(); Assert.Equal("Zero", result[0].Name); }
public void DoesNothingIfValueEqualsMaximumValue_BoundaryValueTest() { var result = SmartFlagTestEnum.FromValue(31); }