File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -969,6 +969,20 @@ public void Test_ObservableProperty_CommandNamesThatCantBeLowered()
969969 Assert . AreSame ( model . c中文Command , fieldInfo ? . GetValue ( model ) ) ;
970970 }
971971
972+ // See https://github.com/CommunityToolkit/dotnet/issues/375
973+ [ TestMethod ]
974+ public void Test_ObservableProperty_ModelWithObservablePropertyWithUnderscoreAndUppercase ( )
975+ {
976+ ModelWithObservablePropertyWithUnderscoreAndUppercase model = new ( ) ;
977+
978+ Assert . IsFalse ( model . IsReadOnly ) ;
979+
980+ // Just ensures this builds and the property is generated with the expected name
981+ model . IsReadOnly = true ;
982+
983+ Assert . IsTrue ( model . IsReadOnly ) ;
984+ }
985+
972986 public abstract partial class BaseViewModel : ObservableObject
973987 {
974988 public string ? Content { get ; set ; }
@@ -1553,4 +1567,10 @@ public void c中文()
15531567 {
15541568 }
15551569 }
1570+
1571+ private partial class ModelWithObservablePropertyWithUnderscoreAndUppercase : ObservableObject
1572+ {
1573+ [ ObservableProperty ]
1574+ private bool _IsReadOnly ;
1575+ }
15561576}
You can’t perform that action at this time.
0 commit comments