Skip to content

Commit

Permalink
Fix DependencyProperty test (dotnet#10522)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasGoulet73 authored Feb 28, 2025
1 parent 009ae5a commit 2b923a8
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public void Register_AlreadyRegistered_ThrowsArgumentException()

public static IEnumerable<object?[]> Register_String_Type_Type_ValidateFail_TestData()
{
yield return new object?[] { " ", typeof(int), typeof(DependencyObjectTests), null, 0 };
yield return new object?[] { " ", typeof(int), typeof(DependencyObjectTest1), null, 0 };
yield return new object?[] { " ", typeof(int), typeof(DependencyObject), new PropertyMetadata(), 0 };
yield return new object?[] { "Register_String_Type_Type_ValidateFail_TestData1", typeof(string), typeof(DependencyObjectTests), null, null };
yield return new object?[] { "Register_String_Type_Type_ValidateFail_TestData2", typeof(string), typeof(DependencyObject), new PropertyMetadata(), null };
Expand Down Expand Up @@ -1082,7 +1082,8 @@ public void RegisterAttachedReadOnly_InvokeStringTypeTypePropertyMetadataNullVal
Assert.NotNull(key.DependencyProperty);
Assert.Same(key.DependencyProperty, key.DependencyProperty);

DependencyProperty property = key.DependencyProperty; Assert.NotNull(property.DefaultMetadata);
DependencyProperty property = key.DependencyProperty;
Assert.NotNull(property.DefaultMetadata);
Assert.Same(property.DefaultMetadata, property.DefaultMetadata);
Assert.Null(property.DefaultMetadata.CoerceValueCallback);
Assert.Equal(expectedDefaultValue, property.DefaultMetadata.DefaultValue);
Expand Down Expand Up @@ -1220,4 +1221,8 @@ private class SubDependencyObject : DependencyObject
private class SubDispatcherObject : DispatcherObject
{
}
}

private sealed class DependencyObjectTest1
{
}
}

0 comments on commit 2b923a8

Please sign in to comment.