예제 #1
0
 public void TestViewModel()
 {
     var vm = new ViewModel ();
     vm.PropertyChanged += (sender, args) => {
         if(args.PropertyName=="HasLoadedResources"){
             foreach (var str in vm.Cities)
                 Debug.WriteLine (str);
             foreach (var str in vm.Specialties)
                 Debug.WriteLine (str);
             Assert.AreNotEqual (0, vm.Specialties.Count);
             Assert.AreNotEqual (0, vm.Cities.Count);
             Assert.AreNotEqual (0, vm.Favorites.Count);
         }
     };
     IsolatedStorage ();
     vm.InitResources ();
 }
예제 #2
0
        public void ViewModelFavorites()
        {
            var vm = new ViewModel ();
            vm.InitResources ();
            vm.FavoritesUpdated += (sender,args) => {
                Assert.AreNotEqual (0, vm.Favorites.Count);
            };

            if (vm.Favorites.Count == 0) {
                vm.AddFavorite(new MedicalProvider (){ id=999});
            } else {
                vm.RemoveFavorite (vm.Favorites [0]);
            }
        }