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()
969
969
Assert . AreSame ( model . c中文Command , fieldInfo ? . GetValue ( model ) ) ;
970
970
}
971
971
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
+
972
986
public abstract partial class BaseViewModel : ObservableObject
973
987
{
974
988
public string ? Content { get ; set ; }
@@ -1553,4 +1567,10 @@ public void c中文()
1553
1567
{
1554
1568
}
1555
1569
}
1570
+
1571
+ private partial class ModelWithObservablePropertyWithUnderscoreAndUppercase : ObservableObject
1572
+ {
1573
+ [ ObservableProperty ]
1574
+ private bool _IsReadOnly ;
1575
+ }
1556
1576
}
You can’t perform that action at this time.
0 commit comments