Example #1
0
        public void EnqueueFrontPUT10()
        {
            Collection <int> collection;

            int[] ints = new int[5];
            collection = CollectionFactory.Create(ints);
            this.EnqueueFrontPUT(collection, 0);
        }
        public void AddTest10()
        {
            Collection <int> collection;

            int[] ints = new int[5];
            collection = CollectionFactory.Create(ints);
            this.AddTest(collection);
        }
        public void AddPUT17()
        {
            Collection <int> collection;

            int[] ints = new int[9];
            collection = CollectionFactory.Create(ints);
            this.AddPUT(collection);
        }
Example #4
0
        public void DequeueBackEmptyDequePUT11()
        {
            Collection <int> collection;

            int[] ints = new int[4];
            collection = CollectionFactory.Create(ints);
            this.DequeueBackEmptyDequePUT(collection);
        }
        public void DequeueFrontEmptyDequePUT12()
        {
            Collection <int> collection;

            int[] ints = new int[5];
            collection = CollectionFactory.Create(ints);
            this.DequeueFrontEmptyDequePUT(collection);
        }
        public IEnumerable <TElement> FindAll <TElement>(How how, string @using) where TElement : IHtmlElement, new()
        {
            var elementsCollection = CollectionFactory.Create <TElement>(this, new Locator(how, @using));

            foreach (var element in elementsCollection)
            {
                yield return(element);
            }
        }
Example #7
0
        public void IsSynchronizedTest18()
        {
            Collection <int> collection;

            int[] ints = new int[5];
            collection = CollectionFactory.Create(ints);
            this.IsSynchronizedTest(collection);
            PexAssert.IsNotNull((object)collection);
        }
Example #8
0
        public IEnumerable <TElement> FindAll <TElement>(Locator locator) where TElement : IHtmlElement, new()
        {
            var elementsCollection = CollectionFactory.Create <TElement>(this, locator);

            foreach (var element in elementsCollection)
            {
                yield return(element);
            }
        }
        public void PeekBackEmptyDequePUT02()
        {
            Collection <int> collection;

            int[] ints = new int[0];
            collection = CollectionFactory.Create(ints);
            this.PeekBackEmptyDequePUT(collection);
            PexAssert.IsNotNull((object)collection);
        }
Example #10
0
        Collection <TViewModel, TCollectionType>(
            TViewModel instance,
            Expression <Func <TViewModel, IEnumerable <TCollectionType> > > collectionPropertyExpression)
            where TViewModel : INotifyPropertyChanged
        {
            var member     = collectionPropertyExpression.Member();
            var collection = CollectionFactory.Create <TCollectionType>(instance, member);

            return(new CollectionLoaded <TService, TCollectionType>(loaderParams, collection));
        }
Example #11
0
        private IObservableCollection <TCollectionType> LoadCollection()
        {
            var collection = CollectionFactory.Create <TCollectionType>();

            var dataService = new DataService <TService>(loaderParams.ProxyCreator);

            dataService.LoadEnumerable(func, collection);

            return(collection);
        }
        public void AddPUT18()
        {
            Collection <int> collection;

            int[] ints = new int[4];
            ints[0]    = 2;
            ints[1]    = 1;
            ints[3]    = 4;
            collection = CollectionFactory.Create(ints);
            this.AddPUT(collection);
        }
Example #13
0
        public void IsSynchronizedTest16()
        {
            Collection <int> collection;

            int[] ints = new int[2];
            ints[0]    = int.MinValue;
            ints[1]    = 1;
            collection = CollectionFactory.Create(ints);
            this.IsSynchronizedTest(collection);
            PexAssert.IsNotNull((object)collection);
        }
Example #14
0
        public IEntityCollection CreateCollection(string name)
        {
            var collection = CollectionFactory.Create(name);

            collections.Add(name, collection);

            SubscribeToCollection(collection);

            collectionAdded.OnNext(collection);

            return(collection);
        }
Example #15
0
        ConvertCollection <TConverted>(IEnumerable <TCollectionType> collection)
        {
            if (collection == null)
            {
                return(null);
            }

            var itemsConverted = collection.Select(x => Mapper.Map <TConverted>(x));

            var converted = CollectionFactory.Create(itemsConverted);

            return(converted);
        }
Example #16
0
        public void PageHitShouldLoadPagesFromDatasource()
        {
            ObservableCollection <SampleViewItem> coll = null;

            CollectionFactory.Create <SampleViewItem, ObservableCollection <SampleViewItem> >(pageSize,
                                                                                              new FakePageProvider <ObservableCollection <SampleViewItem> >(),
                                                                                              new FakeCountProvider(totalLen),
                                                                                              (c) => { coll = c; }
                                                                                              );

            var itemInpage0 = coll[pageSize / 2];
            var xxx         = itemInpage0.S1; // force to load

            int index = pageSize / 2;

            Assert.AreEqual("S1=" + index.ToString(), coll[index].S1);
        }
Example #17
0
        public void Completed <TConverted>(Action <IObservableCollection <TConverted> > action)
        {
            var convertedCollection = (IObservableCollection <TConverted>)null;

            if (collection != null)
            {
                convertedCollection = CollectionFactory.Create(collection.Select(x => Mapper.Map <TConverted>(x)));
            }

            if (task == null)
            {
                action(convertedCollection);
                return;
            }

            task.ContinueWith(t => action(convertedCollection), WindowsThreadingFactory.FromCurrentSynchronizationContext());
        }
Example #18
0
        public void BasicFactory()
        {
            ObservableCollection <SampleViewItem> coll = null;

            CollectionFactory.Create <SampleViewItem, ObservableCollection <SampleViewItem> >(pageSize,
                                                                                              new FakePageProvider <ObservableCollection <SampleViewItem> >(),
                                                                                              new FakeCountProvider(totalLen),
                                                                                              (c) => { coll = c; }
                                                                                              );

            Assert.IsNotNull(coll);
            Assert.AreEqual(totalLen, coll.Count);
            Assert.IsTrue(coll.All(k => k is IPageableElement));
            for (int i = 0; i < totalLen; i += pageSize)
            {
                Assert.AreEqual(i / pageSize, (coll[i] as IPageableElement).PageIndex);
                Assert.IsFalse((coll[i] as IPageableElement).Loaded);
                if (i < totalLen)
                {
                    Assert.AreSame(coll[i], coll[i + 1]); // same object inside same page
                }
            }
        }
Example #19
0
        public IEnumerable <IResult> Load()
        {
            Busy = true;
            var qo = new SalesOrderHeaderQueryObject(this,

                                                     (exc) =>
            {
                Execute.OnUIThread(() =>
                                   MessageBox.Show(GetMessage(exc), "ERROR!", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error)
                                   );
            }
                                                     );

            CollectionFactory.Create <SalesOrderHeaderViewItem, ObservableCollection <SalesOrderHeaderViewItem> >
            (
                20
                , qo
                , qo
                , created => { Items = created; Busy = false; Count = Items.Count; }
            );

            yield break;
        }
Example #20
0
 public MainViewModel()
 {
     exceptions = CollectionFactory.Create <ExceptionViewModel>();
 }