public void ShouldStoreProperties()
        {
            var source = new Source();
            var target = new Target();
            var sourceProperty = source.GetType().GetProperty("Text");
            var targetProperty = target.GetType().GetProperty("MyText");

            var handler = new SyncValueToHandler<Source>(m => m.Text, source, target);

            handler.SourceProperty.ShouldBe(sourceProperty);
            handler.TargetProperty.ShouldBe(targetProperty);
            handler.TargetInstance.ShouldBe(target);
            handler.SourceInstance.ShouldBe(source);
        }
        public void ShouldChangeTargetPropertyWhenSourceChanged()
        {
            var source = new Source();
            var target = new Target();
            var handler = new SyncValueToHandler<Source>(m => m.Text, source, target);
            
            source.Text.ShouldBe(null);
            target.MyText.ShouldBe(null);

            source.Text = "Hello";
            target.MyText.ShouldBe("Hello");
        }
        public void ShouldNotUpdateWhenDisposed()
        {
            var source = new Source();
            var target = new Target();

            var handler = new SyncValueToHandler<Source>(m => m.Text, source, target);
            handler.IsSourceDisposed.ShouldBe(false);

            // ---

            source.Text = "Harry";
            target.MyText.ShouldBe("Harry");

            // ---

            handler.Dispose();
            handler.IsDisposed.ShouldBe(true);

            // ---

            source.Text = "Bob";
            target.MyText.ShouldBe("Harry");
        }
        public void ShouldReportDisposedWhenTargetIsDisposed()
        {
            var source = new Source();
            var target = new Target();

            var handler = new SyncValueToHandler<Source>(m => m.Text, source, target);
            handler.IsSourceDisposed.ShouldBe(false);

            target.Dispose();
            handler.IsSourceDisposed.ShouldBe(false);
            handler.IsTargetDisposed.ShouldBe(true);
        }