public static void InsertTest() { Guid[] anArray = { Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid() }; ObservableCollection <Guid> col0 = new ObservableCollection <Guid>((IEnumerable <Guid>)anArray); ObservableCollection <Guid> col1 = new ObservableCollection <Guid>((IEnumerable <Guid>)anArray); ObservableCollection <Guid> col3 = new ObservableCollection <Guid>((IEnumerable <Guid>)anArray); //inserting item at the beginning. Guid g0 = Guid.NewGuid(); col0.Insert(0, g0); Assert.Equal(g0, col0[0]); // inserting item in the middle Guid g1 = Guid.NewGuid(); col1.Insert(1, g1); Assert.Equal(g1, col1[1]); // inserting item at the end. Guid g3 = Guid.NewGuid(); col3.Insert(col3.Count, g3); Assert.Equal(g3, col3[col3.Count - 1]); string[] anArrayString = new string[] { "one", "two", "three", "four" }; ObservableCollection <string> collection = new ObservableCollection <string>((IEnumerable <string>)anArrayString); CollectionAndPropertyChangedTester helper = new CollectionAndPropertyChangedTester(); helper.AddOrInsertItemTest(collection, "seven", 2); helper.AddOrInsertItemTest(collection, "zero", 0); helper.AddOrInsertItemTest(collection, "eight", collection.Count); }
public static void AddTest() { string[] anArray = { "one", "two", "three" }; ObservableCollection<string> col = new ObservableCollection<string>(anArray); CollectionAndPropertyChangedTester helper = new CollectionAndPropertyChangedTester(); helper.AddOrInsertItemTest(col, "four"); }
public static void AddTest() { string[] anArray = { "one", "two", "three" }; ObservableCollection <string> col = new ObservableCollection <string>(anArray); CollectionAndPropertyChangedTester helper = new CollectionAndPropertyChangedTester(); helper.AddOrInsertItemTest(col, "four"); }
public static void InsertTest() { Guid[] anArray = { Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid() }; ObservableCollection<Guid> col0 = new ObservableCollection<Guid>((IEnumerable<Guid>)anArray); ObservableCollection<Guid> col1 = new ObservableCollection<Guid>((IEnumerable<Guid>)anArray); ObservableCollection<Guid> col3 = new ObservableCollection<Guid>((IEnumerable<Guid>)anArray); //inserting item at the beginning. Guid g0 = Guid.NewGuid(); col0.Insert(0, g0); Assert.Equal(g0, col0[0]); // inserting item in the middle Guid g1 = Guid.NewGuid(); col1.Insert(1, g1); Assert.Equal(g1, col1[1]); // inserting item at the end. Guid g3 = Guid.NewGuid(); col3.Insert(col3.Count, g3); Assert.Equal(g3, col3[col3.Count - 1]); string[] anArrayString = new string[] { "one", "two", "three", "four" }; ObservableCollection<string> collection = new ObservableCollection<string>((IEnumerable<string>)anArrayString); CollectionAndPropertyChangedTester helper = new CollectionAndPropertyChangedTester(); helper.AddOrInsertItemTest(collection, "seven", 2); helper.AddOrInsertItemTest(collection, "zero", 0); helper.AddOrInsertItemTest(collection, "eight", collection.Count); }