Beispiel #1
0
        public void CopyItemProperty_defaults_to_exception()
        {
            // ARRANGE
            var sourceNode      = new LeafNode("name", ServiceProvider());
            var destinationNode = new LeafNode("name", ServiceProvider());

            // ACT
            var result = Assert.Throws <PSNotSupportedException>(() => destinationNode.CopyItemProperty(sourceNode, "sourceProperty", "destinationProperty"));

            // ASSERT
            Assert.Equal($"Node(name='name') doesn't provide an implementation of capability 'ICopyItemProperty'.", result.Message);
        }
Beispiel #2
0
        public void CopyItemProperty_invokes_underlying()
        {
            // ARRANGE
            var sourceNode = new LeafNode("name", ServiceProvider());

            var copyItemProperty = this.mocks.Create <ICopyItemProperty>();

            copyItemProperty
            .Setup(sip => sip.CopyItemProperty(sourceNode, "sourceProperty", "destinationProperty"));

            var destinationNode = new LeafNode("name", ServiceProvider(With <ICopyItemProperty>(copyItemProperty)));

            // ACT
            destinationNode.CopyItemProperty(sourceNode, "sourceProperty", "destinationProperty");
        }