コード例 #1
0
        public void Execute_WhenTweetIsNotArchived_ArchivesTweet()
        {
            Tweet tweet = New.Tweet;
            var test = new ArchiveTweetCommand(tweet);

            test.Execute(null);

            Assert.True(tweet.IsArchived);
        }
コード例 #2
0
        public void Execute_WhenTweetIsNotArchived_ArchivesTweet()
        {
            ITweet tweet = A.Tweet.Build();
            var test = new ArchiveTweetCommand(tweet);

            test.Execute(null);

            tweet.IsArchived.Should().Be.True();
        }
コード例 #3
0
        public void CanExecuteChanged_WhenTweetBecomesArchived_IsRaised()
        {
            Tweet tweet = New.Tweet;
            var test = new ArchiveTweetCommand(tweet);

            bool eventRaised = false;
            test.CanExecuteChanged += (sender, args) => eventRaised = true;

            tweet.Archive();

            Assert.True(eventRaised);
        }
コード例 #4
0
        public void CanExecuteChanged_WhenTweetBecomesArchived_IsRaised()
        {
            ITweet tweet = A.Tweet.Build();
            var test = new ArchiveTweetCommand(tweet);

            bool eventRaised = false;
            test.CanExecuteChanged += (sender, args) => eventRaised = true;

            tweet.Archive();

            eventRaised.Should().Be.True();
        }
コード例 #5
0
        public void CanExecute_WhenTweetIsNotArchived_IsTrue()
        {
            var test = new ArchiveTweetCommand(New.Tweet);

            Assert.True(test.CanExecute(null));
        }
コード例 #6
0
        public void CanExecute_WhenTweetIsNotArchived_IsTrue()
        {
            var test = new ArchiveTweetCommand(A.Tweet.Build());

            test.CanExecute(null).Should().Be.True();
        }