public void adds_with_the_entire_provenance_stack()
        {
            var actions = new ConfigurationActionSet("something");
            actions.Fill(provenanceStack, new UniquePolicy());

            var log = actions.Logs.Single();

            log.ProvenanceChain.Chain.ShouldHaveTheSameElementsAs(provenanceStack);
        }
        public void latches_duplicate_types_if_they_are_unique()
        {
            var policy1 = new UniquePolicy();
            var policy2 = new UniquePolicy();

            var actions = new ConfigurationActionSet();
            actions.Fill(policy1);

            // policy2 should be treated as a duplicate of policy1
            actions.Fill(policy2);

            actions.Actions.Single().ShouldBeTheSameAs(policy1);
        }
        public void can_register_actions_of_the_same_type_that_are_determined_to_not_be_equivalent()
        {
            var policy1 = new ConfiguredPolicy("foo");
            var policy2 = new ConfiguredPolicy("bar");

            policy1.ShouldNotBe(policy2);

            var actions = new ConfigurationActionSet();
            actions.Fill(policy1);

            // policy2 should be treated as a duplicate of policy1
            actions.Fill(policy2);

            actions.Actions.ShouldHaveTheSameElementsAs(policy1, policy2);
        }
 public void Import(ConfigurationActionSet others)
 {
     others._actions.Each(Fill);
 }
        public void will_not_double_register_actions_that_are_determined_to_be_equivalent()
        {
            var policy1 = new ConfiguredPolicy("foo");
            var policy2 = new ConfiguredPolicy("foo");

            policy1.ShouldBe(policy2);

            var actions = new ConfigurationActionSet();
            actions.Fill(policy1);

            // policy2 should be treated as a duplicate of policy1
            actions.Fill(policy2);

            actions.Actions.Single().ShouldBeTheSameAs(policy1);
        }
Exemple #6
0
 public void Import(ConfigurationActionSet others)
 {
     others._actions.Each(Fill);
 }
 public void try_to_add_without_provenance_throws_exception()
 {
     Exception<ArgumentException>.ShouldBeThrownBy(() => {
         var actions = new ConfigurationActionSet("something");
         actions.Fill(new Provenance[0], new UniquePolicy());
     });
 }