Пример #1
0
        public void Should_remove_immediate_child()
        {
            ushort child          = 20;
            ushort child2         = 25;
            ushort sibling        = 30;
            ushort parent         = 5;
            ushort objectToRemove = child;

            var(childZObj, parentZObj, _)
                = ZMachineObjectBuilder.BuildSimpleRelationship(parent, child, sibling, child2);

            Mockery
            .SetGetObject(child, childZObj)
            .SetGetObject(parent, parentZObj);

            var args = new OperandBuilder()
                       .WithArg(objectToRemove)
                       .Build();

            Operation.Execute(args);

            parentZObj.Child.ShouldBe(childZObj.Sibling);
            childZObj.Parent.ShouldBe((ushort)0);
        }