public static KeyValuePair<TestItem, TestItemViewModel> ExistingDestCollNotEqual() { var testItem = new TestItem(); var testItemVm = new TestItemViewModel(); var testItems = new List<TestCollection>(); var testItemsVm = new List<TestCollectionViewModel>(); for (var i = 0; i < 10; i++) { var id = Guid.NewGuid(); var format = string.Format("Name - {0}", i); var name = string.Format("{0} - CHANGED!", format); var testCollection = new TestCollection { Id = id, Name = name }; var testCollectionVm = new TestCollectionViewModel { Id = id, Name = format }; if (i < 6) { testItems.Add(testCollection); } testItemsVm.Add(testCollectionVm); } testItem.Collection = testItems; testItemVm.Array = testItemsVm.ToArray(); return new KeyValuePair<TestItem, TestItemViewModel>(testItem, testItemVm); }
public static KeyValuePair<TestItem, TestItemViewModel> ExistingDestCollEqualsWithNullElement() { var testItem = new TestItem(); var testItemVm = new TestItemViewModel(); var testItems = new List<TestCollection>(); var testItemsVm = new List<TestCollectionViewModel>(); for (var i = 0; i < 5; i++) { var id = Guid.NewGuid(); var format = string.Format("Name - {0}", i); var name = string.Format("{0} - CHANGED!", format); var testCollection = new TestCollection { Id = id, Name = name }; var testCollectionVm = new TestCollectionViewModel { Id = id, Name = format }; testItems.Add(testCollection); testItemsVm.Add(i == 3 ? null : testCollectionVm); } testItem.Queryable = testItems.AsQueryable(); testItemVm.Array = testItemsVm.ToArray(); return new KeyValuePair<TestItem, TestItemViewModel>(testItem, testItemVm); }
public static KeyValuePair<TestItem, TestItemViewModel> CollectionTypeMap() { var random = new Random(); var next = random.Next(5, 10); var testCollections = new List<TestCollection>(); var testCollectionViewModels = new List<TestCollectionViewModel>(); for (var i = 0; i < next; i++) { var newGuid = Guid.NewGuid(); testCollections.Add(new TestCollection { Id = newGuid, Name = string.Format("Name - {0}", i) }); testCollectionViewModels.Add(new TestCollectionViewModel { Id = newGuid, Name = string.Format("Name - {0}", i) }); } var testItem = new TestItem { Array = testCollections.ToArray(), Collection = testCollections, Enumerable = testCollections, List = testCollections, Queryable = testCollections.AsQueryable() }; var testItemViewModel = new TestItemViewModel { Array = testCollectionViewModels.ToArray(), Collection = testCollectionViewModels, Enumerable = testCollectionViewModels, List = testCollectionViewModels, Queryable = testCollectionViewModels.AsQueryable() }; var keyValuePair = new KeyValuePair<TestItem, TestItemViewModel>(testItem, testItemViewModel); return keyValuePair; }
public static KeyValuePair<TestItem, TestItemViewModel> OtherCollectionMapTest() { var testItem = new TestItem(); var testItemVm = new TestItemViewModel(); var testItems = new List<TestCollection>(); var testItemsVm = new List<TestCollectionViewModel>(); for (var i = 0; i < 5; i++) { var id = Guid.NewGuid(); var format = string.Format("Name - {0}", i); var testCollection = new TestCollection { Id = id, Name = format }; var testCollectionVm = new TestCollectionViewModel { Id = id, Name = format }; testItems.Add(testCollection); testItemsVm.Add(testCollectionVm); } testItem.Array = testItems.ToArray(); testItemVm.ObservableCollection = new ObservableCollection<TestCollectionViewModel>(testItemsVm); return new KeyValuePair<TestItem, TestItemViewModel>(testItem, testItemVm); }
public static Tuple<TestItem, TestItemViewModel, TestItemViewModel> ExistingDestCollGreater() { var testItem = new TestItem(); var testItemVm = new TestItemViewModel(); var testItemVmCheck = new TestItemViewModel(); var testItems = new List<TestCollection>(); var testItemsVm = new List<TestCollectionViewModel>(); var testItemsVmCheck = new List<TestCollectionViewModel>(); for (var i = 0; i < 10; i++) { var id = Guid.NewGuid(); var format = string.Format("Name - {0}", i); var name = string.Format("{0} - CHANGED!", format); var testCollection = new TestCollection { Id = id, Name = name }; var testCollectionVm = new TestCollectionViewModel { Id = id, Name = format }; var testCollectionVmCheck = new TestCollectionViewModel { Id = id, Name = name }; if (i < 6) { testItems.Add(testCollection); testItemsVmCheck.Add(testCollectionVmCheck); } testItemsVm.Add(testCollectionVm); } testItem.Collection = testItems.ToArray(); testItemVm.List = testItemsVm; testItemVmCheck.List = testItemsVmCheck.ToList(); return new Tuple<TestItem, TestItemViewModel, TestItemViewModel>(testItem, testItemVm, testItemVmCheck); }
public static Tuple<TestItem, TestItemViewModel, TestItemViewModel> ExistingDestCollEquals() { var testItem = new TestItem(); var testItemVm = new TestItemViewModel(); var testItemVmCheck = new TestItemViewModel(); var testItems = new List<TestCollection>(); var testItemsVm = new List<TestCollectionViewModel>(); var testItemsVmCheck = new List<TestCollectionViewModel>(); for (var i = 0; i < 5; i++) { var id = Guid.NewGuid(); var format = string.Format("Name - {0}", i); var name = string.Format("{0} - CHANGED!", format); var testCollection = new TestCollection { Id = id, Name = name }; var testCollectionVm = new TestCollectionViewModel { Id = id, Name = format }; var testCollectionVmCheck = new TestCollectionViewModel { Id = id, Name = name }; testItems.Add(testCollection); testItemsVm.Add(testCollectionVm); testItemsVmCheck.Add(testCollectionVmCheck); } testItem.Queryable = testItems.AsQueryable(); testItemVm.Array = testItemsVm.ToArray(); testItemVmCheck.Array = testItemsVmCheck.ToArray(); return new Tuple<TestItem, TestItemViewModel, TestItemViewModel>(testItem, testItemVm, testItemVmCheck); }