Example #1
0
        public void Relational_Store_Deletes_all_records_with_string_id()
        {
            var BuildingStore = new PgRelationalStore <Building>(_db);
            var myBatch       = new List <Building>();
            int qtyToAdd      = 10;

            for (int i = 0; i < qtyToAdd; i++)
            {
                var newBuilding = new Building {
                    BIN = "OR500-" + i, Identifier = "Building " + i, PropertyId = i
                };
                myBatch.Add(newBuilding);
            }
            BuildingStore.Add(myBatch);

            // Re-load from back-end:
            var buildings = BuildingStore.TryLoadData();
            int qtyAdded  = buildings.Count;

            // Delete:
            BuildingStore.DeleteAll();
            int remaining = BuildingStore.TryLoadData().Count;

            Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0);
        }
Example #2
0
        public void Relational_Store_Deletes_all_records_with_pg_names()
        {
            var UnitStore = new PgRelationalStore <Unit>(_db);
            var myBatch   = new List <Unit>();
            int qtyToAdd  = 10;

            for (int i = 0; i < qtyToAdd; i++)
            {
                var newUnit = new Unit {
                    BIN = "OR09-" + i, UnitNo = "G-10" + i
                };
                myBatch.Add(newUnit);
            }
            UnitStore.Add(myBatch);

            // Re-load from back-end:
            var companies = UnitStore.TryLoadData();
            int qtyAdded  = companies.Count;

            // Delete:
            UnitStore.DeleteAll();
            int remaining = UnitStore.TryLoadData().Count;

            Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0);
        }
        public void Relational_Store_Deletes_all_records_with_name_attributes()
        {
            var WorkOrderStore = new PgRelationalStore <WorkOrder>(_db);
            var myBatch        = new List <WorkOrder>();
            int qtyToAdd       = 10;

            for (int i = 0; i < qtyToAdd; i++)
            {
                var newWorkOrder = new WorkOrder {
                    Description = "Kill Roaches dead " + i
                };
                myBatch.Add(newWorkOrder);
            }
            WorkOrderStore.Add(myBatch);

            // Re-load from back-end:
            var workOrders = WorkOrderStore.TryLoadData();
            int qtyAdded   = workOrders.Count;

            // Delete:
            WorkOrderStore.DeleteAll();
            int remaining = WorkOrderStore.TryLoadData().Count;

            Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0);
        }
        public void Relational_Store_Deletes_all_records_with_serial_id()
        {
            var PropertyStore = new PgRelationalStore <Property>(_db);
            var myBatch       = new List <Property>();
            int qtyToAdd      = 10;

            for (int i = 0; i < qtyToAdd; i++)
            {
                myBatch.Add(new Property {
                    Name = "Park Place" + i, Address = i + " Property Parkway, Portland, OR 97204"
                });
            }
            PropertyStore.Add(myBatch);

            // Re-load from back-end:
            var companies = PropertyStore.TryLoadData();
            int qtyAdded  = companies.Count;

            // Delete:
            PropertyStore.DeleteAll();
            int remaining = PropertyStore.TryLoadData().Count;

            Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0);
        }
    public void Relational_Store_Deletes_all_records_with_string_id() {
      var BuildingStore = new PgRelationalStore<Building>(_db);
      var myBatch = new List<Building>();
      int qtyToAdd = 10;
      for (int i = 0; i < qtyToAdd; i++) {
        var newBuilding = new Building { BIN = "OR500-" + i, Identifier = "Building " + i, PropertyId = i };
        myBatch.Add(newBuilding);
      }
      BuildingStore.Add(myBatch);

      // Re-load from back-end:
      var buildings = BuildingStore.TryLoadData();
      int qtyAdded = buildings.Count;

      // Delete:
      BuildingStore.DeleteAll();
      int remaining = BuildingStore.TryLoadData().Count;
      Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0);
    }
    public void Relational_Store_Deletes_all_records_with_serial_id() {
      var PropertyStore = new PgRelationalStore<Property>(_db);
      var myBatch = new List<Property>();
      int qtyToAdd = 10;
      for (int i = 0; i < qtyToAdd; i++) {
        myBatch.Add(new Property { Name = "Park Place" + i, Address = i + " Property Parkway, Portland, OR 97204" });
      }
      PropertyStore.Add(myBatch);

      // Re-load from back-end:
      var companies = PropertyStore.TryLoadData();
      int qtyAdded = companies.Count;

      // Delete:
      PropertyStore.DeleteAll();
      int remaining = PropertyStore.TryLoadData().Count;
      Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0);
    }
    public void Relational_Store_Deletes_all_records_with_pg_names() {
      var UnitStore = new PgRelationalStore<Unit>(_db);
      var myBatch = new List<Unit>();
      int qtyToAdd = 10;
      for (int i = 0; i < qtyToAdd; i++) {
        var newUnit = new Unit { BIN = "OR09-" + i, UnitNo = "G-10" + i };
        myBatch.Add(newUnit);
      }
      UnitStore.Add(myBatch);

      // Re-load from back-end:
      var companies = UnitStore.TryLoadData();
      int qtyAdded = companies.Count;

      // Delete:
      UnitStore.DeleteAll();
      int remaining = UnitStore.TryLoadData().Count;
      Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0);
    }
    public void Relational_Store_Deletes_all_records_with_name_attributes() {
      var WorkOrderStore = new PgRelationalStore<WorkOrder>(_db);
      var myBatch = new List<WorkOrder>();
      int qtyToAdd = 10;
      for (int i = 0; i < qtyToAdd; i++) {
        var newWorkOrder = new WorkOrder { Description = "Kill Roaches dead " + i };
        myBatch.Add(newWorkOrder);
      }
      WorkOrderStore.Add(myBatch);

      // Re-load from back-end:
      var workOrders = WorkOrderStore.TryLoadData();
      int qtyAdded = workOrders.Count;

      // Delete:
      WorkOrderStore.DeleteAll();
      int remaining = WorkOrderStore.TryLoadData().Count;
      Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0);
    }