Esempio n. 1
0
        public void StaticRepoViewModel_ClearAllTest()
        {
            //Arrange
            USCoin penny = new Penny();

            //Act
            vm.AddCoin(penny);
            vm.AddCoin(penny);
            vm.ClearAll();

            //Assert
            Assert.AreEqual(StaticRepoViewModel.CoinViews.Count, 0);
            Assert.AreEqual(StaticRepoViewModel.CoinNames.Count, 0);
            Assert.AreEqual(StaticInformation.MainRepo.Coins.Count, 0);
        }
        public void StaticRepoViewModel_NotifyPropertyChangedTest()
        {
            //Arrange
            StaticRepoViewModel vm             = new StaticRepoViewModel();
            List <string>       receivedEvents = new List <string>();

            StaticRepoViewModel.CoinViews.CollectionChanged += delegate(object sender, NotifyCollectionChangedEventArgs e)
            {
                receivedEvents.Add(sender.GetType().ToString());
            };

            //Act
            vm.AddCoin(new Penny());

            //Assert
            Assert.IsTrue(receivedEvents.Count > 0);
        }