public void IsDefined_WithInvalidIntegerValue_ShouldReturnFalse() { var testValue = new FirstEnum(TestEnum.Value.First); var result = testValue.IsDefined((int)TestEnum.Value.Second); Assert.IsFalse(result); }
public void IsDefined_WithValidIntegerValue_ShouldReturnTrue() { var testValue = new FirstEnum(TestEnum.Value.First); var result = testValue.IsDefined((int)TestEnum.Value.First); Assert.IsTrue(result); }
public void IsDefined_WithDifferentEnumValueTypeAndValidUnderlyingValue_ShouldReturnFalse() { var testValue = new FirstEnum(TestEnum.Value.First); var testObject = new CombinedEnum(TestEnum.Value.Unknown);; var result = testValue.IsDefined(testObject); Assert.IsFalse(result); }
public void IsDefined_WithValidObjectEnumValue_ShouldReturnTrue() { var testValue = new FirstEnum(TestEnum.Value.First); var testObject = new FirstEnum(TestEnum.Value.First); var result = testValue.IsDefined(testObject); Assert.IsTrue(result); }
public void IsDefined_WithInvalidEnumAsObjectValue_ShouldReturnFalse() { var testValue = new FirstEnum(TestEnum.Value.First); var testObject = (object)TestEnum.Value.Second; var result = testValue.IsDefined(testObject); Assert.IsFalse(result); }