コード例 #1
0
        public void TestFoo()
        {
            Changer changer = new Changer();

            PropertyChangedTester<Changer> tester = new PropertyChangedTester<Changer>(changer);

            tester.PropertyChanged(c => c.Text);
        }
コード例 #2
0
        public void CheckPropertyChanged()
        {
            GetStatuses(true);

            PropertyChangedTester<QueryResultsViewModel> tester =
                new PropertyChangedTester<QueryResultsViewModel>(this._vm);

            this._vm.SelectedTweet = this._vm.Tweets[0];

            tester.PropertyChanged(v => v.SelectedTweet);
        }
コード例 #3
0
        public void SelectedTweetIsRetainedAfterRefresh()
        {
            _service.Setup(a => a.GetLatest()).Returns(
                CreateStatuses(1, 10).ToArray());

            _refreshEvent.Object.Publish(true);

            _vm.SelectedTweet = _vm.Tweets[5];
            Assert.That(_vm.SelectedTweet.Status.Id, Is.EqualTo(6));

            _service.Setup(a => a.GetNewer(_vm.Tweets[0].Status)).Returns(
                CreateStatuses(3, 13).ToArray());

            var tester = new PropertyChangedTester<QueryResultsViewModel>(_vm);
            _refreshEvent.Object.Publish(null);

            Assert.That(_vm.SelectedTweet.Status.Id, Is.EqualTo(6));
            Assert.That(tester.PropertyChanged(p => p.SelectedTweet), Is.True);
        }
コード例 #4
0
        public void MoveUpRaisesPropertyChanged()
        {
            GetStatuses();
            this._vm.SelectedTweet = this._vm.Tweets[1];

            var tester = new PropertyChangedTester<QueryResultsViewModel>(this._vm);
            ExecuteMoveUp();

            tester.PropertyChanged(v => v.SelectedTweet);
        }