File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
src/Mono.Android/Android.Runtime
tests/Mono.Android-Tests/Java.Interop Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -551,8 +551,6 @@ public virtual bool Add (Java.Lang.Object? item)
551551
552552 public virtual bool Add ( int index , Java . Lang . Object ? item )
553553 {
554- if ( Contains ( item ) )
555- return false ;
556554 Add ( ( object ? ) item ) ;
557555 return true ;
558556 }
Original file line number Diff line number Diff line change @@ -15,6 +15,18 @@ namespace Java.InteropTests
1515 [ SetUp ]
1616 public void Setup ( ) => list = new T ( ) ;
1717
18+ [ Test ]
19+ public void Add ( )
20+ {
21+ list . Add ( "foo" ) ;
22+ Assert . AreEqual ( "foo" , list [ 0 ] ) ;
23+
24+ // Ensure duplicates are allowed.
25+ list . Add ( "foo" ) ;
26+ Assert . AreEqual ( 2 , list . Count ) ;
27+ Assert . AreEqual ( "foo" , list [ 1 ] ) ;
28+ }
29+
1830 [ Test ]
1931 public void Count ( )
2032 {
You can’t perform that action at this time.
0 commit comments