Skip to content

Commit ebab9e1

Browse files
committed
Update BindablePropertyName_WithInitializer_ReturnsCorrectEffectiveDefaultValueCreatorMethodName for clarity
1 parent 8c823de commit ebab9e1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/CommunityToolkit.Maui.SourceGenerators.Internal.UnitTests/BindablePropertyModelTests.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,11 @@ public void BindablePropertyName_WithInitializer_ReturnsCorrectEffectiveDefaultV
171171
var typeSymbol = compilation.GetTypeByMetadataName("TestClass")!;
172172
var propertySymbol = typeSymbol.GetMembers("TestProperty").OfType<IPropertySymbol>().First();
173173

174+
const string propertyName = "TestProperty";
175+
const bool hasInitializer = true;
176+
174177
var model = new BindablePropertyModel(
175-
"TestProperty",
178+
propertyName,
176179
propertySymbol.Type,
177180
typeSymbol,
178181
"null",
@@ -183,15 +186,15 @@ public void BindablePropertyName_WithInitializer_ReturnsCorrectEffectiveDefaultV
183186
"null",
184187
"null",
185188
string.Empty,
186-
true, // IsReadOnlyBindableProperty
187-
string.Empty, // SetterAccessibility
188-
true
189+
true,
190+
string.Empty,
191+
hasInitializer
189192
);
190193

191194
// Act
192195
var effectiveDefaultValueCreatorMethodName = model.EffectiveDefaultValueCreatorMethodName;
193196

194197
// Assert
195-
Assert.Equal("__createDefaultTestProperty", effectiveDefaultValueCreatorMethodName);
198+
Assert.Equal("__createDefault" + propertyName, effectiveDefaultValueCreatorMethodName);
196199
}
197200
}

0 commit comments

Comments
 (0)