Beispiel #1
0
        public void OnAttachTo_WithNull_TargetSetToNull()
        {
            // Arrange
            var behavior = new TranslationBehaviour();

            // Act
            behavior.CallOnAttachedTo(null);

            // Assert
            Assert.IsNull(behavior.Target);
        }
Beispiel #2
0
        public void OnAttachTo_WithBindable_TargetSetToBindable()
        {
            // Arrange
            var testBindable = new TestBindableObject();
            var behavior     = new TranslationBehaviour();

            // Act
            behavior.CallOnAttachedTo(testBindable);

            // Assert
            Assert.AreEqual(testBindable, behavior.Target);
        }
Beispiel #3
0
        public void OnDetachingFrom_WithBindable_TargetSetToNull()
        {
            // Arrange
            var testBindable = new TestBindableObject();
            var behavior     = new TranslationBehaviour();

            behavior.CallOnAttachedTo(testBindable);

            // Act
            behavior.CallOnDetachingFrom(testBindable);

            // Assert
            Assert.IsNull(behavior.Target);
        }