示例#1
0
        public void value_miss()
        {
            var action = MockRepository.GenerateMock <Action <string, string> >();

            theValues["Key1"] = "a";
            theValues["Key2"] = "a";
            theValues["Key3"] = "a";

            thePrefixedValues.ForValue("Key1", action).ShouldBeFalse();

            action.AssertWasNotCalled(x => x.Invoke(null, null), x => x.IgnoreArguments());
        }
示例#2
0
        public void value_hit_grandchild()
        {
            theValues["Key1"]        = "a";
            theValues["Key2"]        = "a";
            theValues["Key3"]        = "a";
            theValues["OneKey4"]     = "a4";
            theValues["OneTwoKey11"] = "1211";
            theValues["OneKey5"]     = "a";
            theValues["OneKey6"]     = "a";

            var action     = MockRepository.GenerateMock <Action <string, string> >();
            var grandchild = new PrefixedKeyValues("Two", thePrefixedValues);

            grandchild.ForValue("Key11", action).ShouldBeTrue();

            action.AssertWasCalled(x => x.Invoke("OneTwoKey11", "1211"));
        }
        public void value_hit_grandchild()
        {
            theValues["Key1"] = "a";
            theValues["Key2"] = "a";
            theValues["Key3"] = "a";
            theValues["OneKey4"] = "a4";
            theValues["OneTwoKey11"] = "1211";
            theValues["OneKey5"] = "a";
            theValues["OneKey6"] = "a";

            var action = MockRepository.GenerateMock<Action<string, string>>();
            var grandchild = new PrefixedKeyValues("Two", thePrefixedValues);

            grandchild.ForValue("Key11", action).ShouldBeTrue();

            action.AssertWasCalled(x => x.Invoke("OneTwoKey11", "1211"));
        }