Exemplo n.º 1
0
        public void ListTest()
        {
            var cars = LazyProxy <LazyList <Car> > .Make(
                () => MakeCars()
                );

            Debug.WriteLine(cars.Count);

            foreach (var car in (IEnumerable)cars)
            {
                if (car != null)
                {
                    Debug.WriteLine(((Car)car).Make + " " + ((Car)car).Model);
                }
            }
        }
Exemplo n.º 2
0
        public void test1()
        {
            var car = LazyProxy <Car> .Make(
                () => MakeActualCar()
                );

            DoNothingWithACar(car);
            Assert.IsFalse(loaded);

            DoSomethingWithACar(car);
            Assert.IsTrue(loaded);

            car.DoNothing();

            Assert.AreEqual("Ford", car.Make);
        }