@@ -161,56 +161,4 @@ static Compilation CreateCompilation(string source)
161161 references ,
162162 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
163163 }
164-
165- [ Fact ]
166- public void BindablePropertyModel_WithInitializer_GeneratesDefaultValueCreator ( )
167- {
168- // Arrange
169- var compilation = CreateCompilation ( "public class TestClass { public string TestProperty { get; set; } = \" Hello\" ; }" ) ;
170- var typeSymbol = compilation . GetTypeByMetadataName ( "TestClass" ) ! ;
171- var propertySymbol = typeSymbol . GetMembers ( "TestProperty" ) . OfType < IPropertySymbol > ( ) . First ( ) ;
172-
173- const string propertyName = "TestProperty" ;
174- const string defaultValue = "\" Hello\" " ;
175- const string defaultBindingMode = "Microsoft.Maui.Controls.BindingMode.TwoWay" ;
176- const string validateValueMethodName = "ValidateValue" ;
177- const string propertyChangedMethodName = "OnPropertyChanged" ;
178- const string propertyChangingMethodName = "OnPropertyChanging" ;
179- const string coerceValueMethodName = "CoerceValue" ;
180- const string defaultValueCreatorMethodName = "__createDefaultTestProperty" ;
181- const string newKeywordText = "new " ;
182- const bool hasInitializer = true ;
183-
184- // Act
185- var model = new BindablePropertyModel (
186- propertyName ,
187- propertySymbol . Type ,
188- typeSymbol ,
189- defaultValue ,
190- defaultBindingMode ,
191- validateValueMethodName ,
192- propertyChangedMethodName ,
193- propertyChangingMethodName ,
194- coerceValueMethodName ,
195- defaultValueCreatorMethodName ,
196- newKeywordText ,
197- true , // IsReadOnlyBindableProperty
198- string . Empty , // SetterAccessibility
199- hasInitializer ) ;
200-
201- // Assert
202- Assert . Equal ( propertyName , model . PropertyName ) ;
203- Assert . Equal ( propertySymbol . Type , model . ReturnType ) ;
204- Assert . Equal ( typeSymbol , model . DeclaringType ) ;
205- Assert . Equal ( defaultValue , model . DefaultValue ) ;
206- Assert . Equal ( defaultBindingMode , model . DefaultBindingMode ) ;
207- Assert . Equal ( validateValueMethodName , model . ValidateValueMethodName ) ;
208- Assert . Equal ( propertyChangedMethodName , model . PropertyChangedMethodName ) ;
209- Assert . Equal ( propertyChangingMethodName , model . PropertyChangingMethodName ) ;
210- Assert . Equal ( coerceValueMethodName , model . CoerceValueMethodName ) ;
211- Assert . Equal ( defaultValueCreatorMethodName , model . DefaultValueCreatorMethodName ) ;
212- Assert . Equal ( newKeywordText , model . NewKeywordText ) ;
213- Assert . Equal ( hasInitializer , model . HasInitializer ) ;
214- Assert . Equal ( "TestPropertyProperty" , model . BindablePropertyName ) ;
215- }
216164}
0 commit comments