Ejemplo n.º 1
0
        public void latches_duplicate_types_if_they_are_unique()
        {
            var policy1 = new UniquePolicy();
            var policy2 = new UniquePolicy();

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

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

            actions.Actions.Single().ShouldBeTheSameAs(policy1);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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.ShouldNotEqual(policy2);

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

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

            actions.Actions.ShouldHaveTheSameElementsAs(policy1, policy2);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
 public void try_to_add_without_provenance_throws_exception()
 {
     Exception <ArgumentException> .ShouldBeThrownBy(() => {
         var actions = new ConfigurationActionSet("something");
         actions.Fill(new Provenance[0], new UniquePolicy());
     });
 }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
        public void will_not_double_register_actions_that_are_determined_to_be_equivalent()
        {
            var policy1 = new ConfiguredPolicy("foo");
            var policy2 = new ConfiguredPolicy("foo");

            policy1.ShouldEqual(policy2);

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

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

            actions.Actions.Single().ShouldBeTheSameAs(policy1);
        }
Ejemplo n.º 9
0
 public void AddGlobal(IConfigurationAction action, FubuTransportRegistry registry)
 {
     _globalPolicies.Fill(action);
 }