Beispiel #1
0
        public void Biggylist_Updates_Range_Of_Items_In_Json_Store()
        {
            var propertyList = new BiggyList <Property>(_propertyStore);
            int initialCount = propertyList.Count;

            var myBatch  = new List <Property>();
            int qtyToAdd = 10;

            // This test uses an initial index value of 1 so taht there is a non-zero ID for the first item:
            for (int i = 1; i <= qtyToAdd; i++)
            {
                myBatch.Add(new Property {
                    Id = i, Name = "John's Luxury Townhomes" + i, Address = i + " Property Parkway, Portland, OR 97204"
                });
            }
            propertyList.Add(myBatch);

            // Just to be sure, reload from backing store and check what was added:
            propertyList = new BiggyList <Property>(_propertyStore);
            int addedCount = propertyList.Count;

            // Update each item:
            for (int i = 0; i < qtyToAdd; i++)
            {
                propertyList.ElementAt(i).Name = "John's Low-Rent Brick Homes " + i;
            }
            propertyList.Update(propertyList.ToList());

            // Reload, and check updated names:
            propertyList = new BiggyList <Property>(_propertyStore);
            var updatedItems = propertyList.Where(p => p.Name.Contains("Low-Rent Brick"));

            Assert.IsTrue(updatedItems.Count() == qtyToAdd);
        }
        public void Biggylist_Updates_Range_Of_Items_In_Sqlite_Store()
        {
            var PropertyDocumentList = new BiggyList <PropertyDocument>(_PropertyDocumentStore);
            int initialCount         = PropertyDocumentList.Count;

            var myBatch  = new List <PropertyDocument>();
            int qtyToAdd = 10;

            for (int i = 1; i <= qtyToAdd; i++)
            {
                myBatch.Add(new PropertyDocument {
                    Name = "John's Luxury Townhomes" + i, Address = i + " PropertyDocument Parkway, Portland, OR 97204"
                });
            }
            PropertyDocumentList.Add(myBatch);

            // Just to be sure, reload from backing store and check what was added:
            PropertyDocumentList = new BiggyList <PropertyDocument>(_PropertyDocumentStore);
            int addedCount = PropertyDocumentList.Count;

            // Update each item:
            for (int i = 0; i < qtyToAdd; i++)
            {
                PropertyDocumentList.ElementAt(i).Name = "John's Low-Rent Brick Homes " + i;
            }
            PropertyDocumentList.Update(PropertyDocumentList.ToList());

            // Reload, and check updated names:
            PropertyDocumentList = new BiggyList <PropertyDocument>(_PropertyDocumentStore);
            var updatedItems = PropertyDocumentList.Where(p => p.Name.Contains("Low-Rent Brick"));

            Assert.IsTrue(updatedItems.Count() == qtyToAdd);
        }
Beispiel #3
0
        public SerieViewModel()
        {
            var _storeLocation = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "CONFIG");

            _serieList = new BiggyList <Serie>(new JsonStore <Serie>(_storeLocation, "Serie"));


            serieList = _serieList.ToList();

            //_serieList.Add(new Serie { SerieId = "1", SerieName = "Games of Throne", SerieSeasson = 10, SerieEpisode = 13 });
            //_serieList.Add(new Serie { SerieId = "2", SerieName = "Goldberg", SerieSeasson = 3, SerieEpisode = 3 });
            //_serieList.Add(new Serie { SerieId = "3", SerieName = "Vikings", SerieSeasson = 20, SerieEpisode = 12 });
            //_serieList.Add(new Serie { SerieId = "4", SerieName = "Big Ben Theory", SerieSeasson = 12, SerieEpisode = 11 });
            //_serieList.Add(new Serie { SerieId = "5", SerieName = "South Park", SerieSeasson = 20, SerieEpisode = 7 });
            //_serieList.Add(new Serie { SerieId = "6", SerieName = "Orange Black", SerieSeasson = 2, SerieEpisode = 20 });

            GetAllSerie();
        }
 public IHttpActionResult GetList()
 {
     return(Ok(errors.ToList()));
 }
    public void Biggylist_Updates_Range_Of_Items_In_Json_Store() {
      var propertyList = new BiggyList<Property>(_propertyStore);
      int initialCount = propertyList.Count;

      var myBatch = new List<Property>();
      int qtyToAdd = 10;

      // This test uses an initial index value of 1 so taht there is a non-zero ID for the first item:
      for (int i = 1; i <= qtyToAdd; i++) {
        myBatch.Add(new Property { Id = i, Name = "John's Luxury Townhomes" + i, Address = i + " Property Parkway, Portland, OR 97204" });
      }
      propertyList.Add(myBatch);

      // Just to be sure, reload from backing store and check what was added:
      propertyList = new BiggyList<Property>(_propertyStore);
      int addedCount = propertyList.Count;

      // Update each item:
      for (int i = 0; i < qtyToAdd; i++) {
        propertyList.ElementAt(i).Name = "John's Low-Rent Brick Homes " + i;
      }
      propertyList.Update(propertyList.ToList());

      // Reload, and check updated names:
      propertyList = new BiggyList<Property>(_propertyStore);
      var updatedItems = propertyList.Where(p => p.Name.Contains("Low-Rent Brick"));
      Assert.IsTrue(updatedItems.Count() == qtyToAdd);
    }
        public IHttpActionResult GetAllBlogLogging()
        {
            var logitems = BlogLogs.ToList();

            return(Ok(logitems));
        }
        public IHttpActionResult GetAll()
        {
            var logitems = Log.ToList();

            return(Ok(logitems));
        }
 public void Initializes_Typed_Store_With_Empty_List()
 {
     Assert.True(_biggyList.ToList() != null);
 }
    public void Biggylist_Updates_Range_Of_Items_In_Sqlite_Store() {
      var PropertyDocumentList = new BiggyList<PropertyDocument>(_PropertyDocumentStore);
      int initialCount = PropertyDocumentList.Count;

      var myBatch = new List<PropertyDocument>();
      int qtyToAdd = 10;
      for (int i = 1; i <= qtyToAdd; i++) {
        myBatch.Add(new PropertyDocument { Name = "John's Luxury Townhomes" + i, Address = i + " PropertyDocument Parkway, Portland, OR 97204" });
      }
      PropertyDocumentList.Add(myBatch);

      // Just to be sure, reload from backing store and check what was added:
      PropertyDocumentList = new BiggyList<PropertyDocument>(_PropertyDocumentStore);
      int addedCount = PropertyDocumentList.Count;

      // Update each item:
      for (int i = 0; i < qtyToAdd; i++) {
        PropertyDocumentList.ElementAt(i).Name = "John's Low-Rent Brick Homes " + i;
      }
      PropertyDocumentList.Update(PropertyDocumentList.ToList());

      // Reload, and check updated names:
      PropertyDocumentList = new BiggyList<PropertyDocument>(_PropertyDocumentStore);
      var updatedItems = PropertyDocumentList.Where(p => p.Name.Contains("Low-Rent Brick"));
      Assert.IsTrue(updatedItems.Count() == qtyToAdd);
    }