コード例 #1
0
        public void TestCustomDelegateFeatures()
        {
            var customDelegateGreen = new MyCustomEnumConditionalRedFeature(() => MyColorEnum.Green);

            Assert.True(customDelegateGreen.Is(MyColorEnum.Green), $"{customDelegateGreen.GetType().Name} delegate failed");

            var customDelegateRed = new MyCustomEnumConditionalGreenFeature(() => MyColorEnum.Red);

            Assert.True(customDelegateRed.Is(MyColorEnum.Red), $"{customDelegateRed.GetType().Name} delegate failed");
        }
コード例 #2
0
        public void TestCustomOverrideFeatures()
        {
            var customGreen = new MyCustomEnumConditionalGreenFeature();

            Assert.True(customGreen.Is(MyColorEnum.Green), $"{customGreen.GetType().Name} failed");

            var customRed = new MyCustomEnumConditionalRedFeature();

            Assert.True(customRed.Is(MyColorEnum.Red), $"{customRed.GetType().Name} failed");
        }