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);
        }
        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);
        }
Exemplo 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.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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
 protected bool Equals(ConfiguredPolicy other)
 {
     return(string.Equals(_name, other._name));
 }
 protected bool Equals(ConfiguredPolicy other)
 {
     return string.Equals(_name, other._name);
 }