Exemplo n.º 1
0
        public void Should_check_prerequisites()
        {
            var featureWithTrueCondition  = new MyFeatureWithSatisfiedPrerequisite();
            var featureWithFalseCondition = new MyFeatureWithUnsatisfiedPrerequisite();

            featureSettings.Add(featureWithTrueCondition);
            featureSettings.Add(featureWithFalseCondition);

            featureSettings.SetupFeatures(new FakeFeatureConfigurationContext());

            Assert.True(featureWithTrueCondition.IsActive);
            Assert.False(featureWithFalseCondition.IsActive);
            Assert.AreEqual("The description",
                            featureSettings.Status.Single(s => s.Name == featureWithFalseCondition.Name).PrerequisiteStatus.Reasons.First());
        }
        public void Should_check_prerequisites()
        {
            var featureWithTrueCondition = new MyFeatureWithSatisfiedPrerequisite();
            var featureWithFalseCondition = new MyFeatureWithUnsatisfiedPrerequisite();

            featureSettings.Add(featureWithTrueCondition);
            featureSettings.Add(featureWithFalseCondition);

            featureSettings.SetupFeatures(null, null);

            Assert.True(featureWithTrueCondition.IsActive);
            Assert.False(featureWithFalseCondition.IsActive);
            Assert.AreEqual("The description",
                featureSettings.Status.Single(s => s.Name == featureWithFalseCondition.Name).PrerequisiteStatus.Reasons.First());
        }