示例#1
0
        public void TryingToCallSetDoesNotBlowUpIfTheIntermediateChildrenAreNotThere()
        {
            var target = new Target
            {
                Child = new ChildTarget()
            };

            _chain.SetValue(target, DateTime.Today.AddDays(4));
        }
示例#2
0
        public void PropertyChainCanSetPRopertyHappyPath()
        {
            var target = new Target
            {
                Child = new ChildTarget
                {
                    GrandChild = new GrandChildTarget
                    {
                        BirthDay = DateTime.Today
                    }
                }
            };

            _chain.SetValue(target, DateTime.Today.AddDays(1));

            target.Child.GrandChild.BirthDay.ShouldBe(DateTime.Today.AddDays(1));
        }