Ejemplo n.º 1
0
        public void GettingScreens_WhenThereIsATweet_ContainsAScreen()
        {
            var mockScreen = Substitute.For<ITweetScreen>();

            var test = new TimelineScreen(new Lazy<ITimeline>(() => _timeline), x => mockScreen);
            test.Initialize();

            _tweets.Add(A.Tweet.Build());

            test.Screens.Should().Contain.Item(mockScreen);
            mockScreen.Received().Initialize();
        }
Ejemplo n.º 2
0
        public void GettingScreens_WhenThereIsATweet_ContainsAScreen()
        {
            var mockScreen = new Mock<ILoadingTweetScreen>();

            var test = new TimelineScreen(_fakeTimeline.Object, x => mockScreen.Object);
            test.Initialize();

            _tweets.Add("5");

            Assert.Contains(mockScreen.Object, test.Screens);
            mockScreen.Verify(x => x.Initialize());
        }
Ejemplo n.º 3
0
        public void SettingSelection_WhenATweetWasSelected_MarksTweetAsRead()
        {
            var mockScreen = Substitute.For<ITweetScreen>();
            var mockCommand = Substitute.For<ICommand>();
            bool commandExecuted = false;

            mockScreen.MarkAsReadCommand.Returns(mockCommand);

            mockCommand.When(x => x.Execute(null)).Do(_ => commandExecuted = true);

            var test = new TimelineScreen(new Lazy<ITimeline>(() => _timeline), x => mockScreen);
            test.Initialize();

            _tweets.Add(A.Tweet.Build());

            test.Selection = mockScreen;
            test.Selection = null;

            Wait.Until(() => commandExecuted);
        }
Ejemplo n.º 4
0
        public void GettingScreens_WhenThereAreNoTweets_IsEmpty()
        {
            var test = new TimelineScreen(new Lazy<ITimeline>(() => _timeline), null);

            test.Screens.Should().Be.Empty();
        }
Ejemplo n.º 5
0
        public void GettingScreens_WhenThereAreNoTweets_IsEmpty()
        {
            var test = new TimelineScreen(_fakeTimeline.Object, null);

            Assert.Empty(test.Screens);
        }