public void EditingQueryParameterWithProgressiveLoading() { IEnumerable <City> cities = new CityData().Cities; int citiesInWA = cities.Count(c => c.StateName == "WA"); int citiesinOH = cities.Count(c => c.StateName == "OH"); EnqueueCallback(() => { // By using a loadsize of 1, we know the number of loads to be performed is equal to the // expected city count + 1 (the load that will determine that there are no more records). this._dds.LoadSize = 1; this._dds.QueryName = "GetCitiesInState"; this._dds.QueryParameters.Add(new Parameter { ParameterName = "state", Value = "WA" }); this._dds.DomainContext = new CityDomainContext(); this._asyncEventFailureMessage = "First Progressive Load"; this._dds.Load(); }); this.AssertLoadingData(citiesInWA + 1, true); EnqueueCallback(() => { this.ResetLoadState(); Assert.AreEqual <int>(citiesInWA, this._view.Count, "The count should match the number of WA cities after the first progressive load"); Assert.IsTrue(this._view.Cast <City>().All(c => c.StateName == "WA"), "All cities should be in WA after the first progressive load"); this._dds.QueryParameters[0].Value = "OH"; // Calling Refresh will test that the load of FirstItems is deferred properly this._collectionView.Refresh(); }); this.AssertLoadingData(citiesinOH + 1, true); EnqueueCallback(() => { this.ResetLoadState(); Assert.AreEqual <int>(citiesinOH, this._view.Count, "The count should match the number of OH cities after the second progressive load"); Assert.IsTrue(this._view.Cast <City>().All(c => c.StateName == "OH"), "All cities should be in OH after the second progressive load"); }); EnqueueTestComplete(); }