예제 #1
0
        public void IsDefined_WithInvalidIntegerValue_ShouldReturnFalse()
        {
            var testValue = new FirstEnum(TestEnum.Value.First);

            var result = testValue.IsDefined((int)TestEnum.Value.Second);

            Assert.IsFalse(result);
        }
예제 #2
0
        public void IsDefined_WithValidIntegerValue_ShouldReturnTrue()
        {
            var testValue = new FirstEnum(TestEnum.Value.First);

            var result = testValue.IsDefined((int)TestEnum.Value.First);

            Assert.IsTrue(result);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }