예제 #1
0
        public MainWindow()
        {
            InitializeComponent();

            Feature2Toggle = new Feature2Toggle();
            Feature3Toggle = new Feature3Toggle();
            ToggleFromJsonHttpEndpoint = new ToggleFromJsonHttpEndpoint();

            Feature5 = new CompositeAndDecorator(new FeatureXToggle(), new FeatureYToggle());

            DataContext = this;
        }
        public void ReturnFalseWhenOneWrappedToggleIsDisabled()
        {
            var sut = new CompositeAndDecorator(new AnEnabledFeature(), new ADisabledFeature());

            Assert.False(sut.FeatureEnabled);
        }
        public void ReturnTrueWhenAllWrappedTogglesAreEnabled()
        {
            var sut = new CompositeAndDecorator(new AnEnabledFeature(), new AnotherEnabledFeature());

            Assert.True(sut.FeatureEnabled);
        }