Esempio n. 1
0
 public void UnreachableTargetShouldNotBeLeaked()
 {
     AssertLifetime.UnreachableInstanceIsNotLeaked(
         () => new Entity(),
         entity => new DependencyPropertyAdapter(entity, Entity.SampleProperty));
 }
Esempio n. 2
0
 public void ReturnedAdapterShouldNotLeakTargetGivenTargetWithDependencyProperty()
 {
     AssertLifetime.UnreachableInstanceIsNotLeaked(
         () => new DependencyObjectTarget(),
         target => ValueAdapterFactory.CreateAdapterFromPropertyName(target, "Value"));
 }
Esempio n. 3
0
 public void ReturnedAdapterShouldNotLeakTargetGivenTargetWithDependencyPropertyInheritedFromBaseClass()
 {
     AssertLifetime.UnreachableInstanceIsNotLeaked(
         () => new Control(),
         target => ValueAdapterFactory.CreateAdapterFromPropertyName(target, "DataContext"));
 }
Esempio n. 4
0
 public void ReturnedAdapterShouldNotLeakTargetGivenPropertyOfNotifyingTarget()
 {
     AssertLifetime.UnreachableInstanceIsNotLeaked(
         () => new NotifyingTarget(),
         target => ValueAdapterFactory.CreateAdapterFromPropertyName(target, "Value"));
 }