public void Remove() { var result = _adapter.Remove("2"); Assert.That(result, Is.True); Assert.That(_innerList, Is.EqualTo(new[] { 1, 3 })); result = _adapter.Remove("2"); Assert.That(result, Is.False); }
private void Rec_BondStateChanged(object sender, BondStateChangedEventArgs e) { if (e.NewState == Bond.Bonded) { ListAdapter.Remove(e.Device.Name); FoundDevices.Remove(e.Device); Toast.MakeText(this, "Gekoppeld met " + e.Device.Name, ToastLength.Short); } else { Toast.MakeText(this, "Bezig met koppelen met " + e.Device.Name, ToastLength.Long); } }
public void RemoveRemovesItemByValue() { var wrappedList = new List <Uri>(); var destList = new ListAdapter <string, Uri>( str => new Uri(str), uri => uri.ToString(), (str, uri) => string.Equals(str, uri?.ToString()), wrappedList) { "http://maps.google.com", "http://www.twitter.com" }; wrappedList.Count.Should().Be(2); destList.Remove("http://www.twitter.com"); wrappedList.Count.Should().Be(1); wrappedList[0].ToString().Should().Be("http://maps.google.com/"); destList[0].Should().Be(wrappedList[0].ToString()); }