public void ProvinceCollectionGetCorrectGaps() { ProvinceCollection pc = new ProvinceCollection(); pc.Add(new SaveProvince(3)); pc.Add(new SaveProvince(5)); pc.Add(new SaveProvince(1)); CollectionAssert.AreEqual(new[] { 1, 3, 5 }, pc.Select(x => x.Id)); Assert.AreEqual(1, pc.Get(1).Id); Assert.AreEqual(3, pc.Get(3).Id); Assert.AreEqual(5, pc.Get(5).Id); }
public void ProvinceCollectionGetCorrectOutOfOrder() { ProvinceCollection pc = new ProvinceCollection(); pc.Add(new SaveProvince(2)); pc.Add(new SaveProvince(3)); pc.Add(new SaveProvince(1)); CollectionAssert.AreEqual(new[] { 1, 2, 3 }, pc.Select(x => x.Id)); Assert.AreEqual(1, pc.Get(1).Id); Assert.AreEqual(2, pc.Get(2).Id); Assert.AreEqual(3, pc.Get(3).Id); }