Esempio n. 1
0
        public void WelcomeScreen_ShowsWelcomeMessage()
        {
            // Arrange
            var consoleMock             = new Mock <IConsole>();
            var socialNetworkConsoleApp = new SocialNetworkConsoleApp(consoleMock.Object);

            consoleMock.Setup(m => m.ReadLine()).Returns("exit");

            // Act
            socialNetworkConsoleApp.Run();

            // Assert
            consoleMock.Verify(m => m.WriteLine("Welcome to Social Network!"), Times.Once);
        }
Esempio n. 2
0
        public void WelcomeScreen_ShowsLoginRequest()
        {
            // Arrange
            var consoleMock             = new Mock <IConsole>();
            var socialNetworkConsoleApp = new SocialNetworkConsoleApp(consoleMock.Object);

            consoleMock.Setup(m => m.ReadLine()).Returns("exit");

            // Act
            socialNetworkConsoleApp.Run();

            // Assert
            consoleMock.Verify(m => m.WriteLine("Please, Login to start: Write your user name."), Times.Once);
        }
Esempio n. 3
0
        public void WelcomeScreen_ShowsTwoLines()
        {
            // Arrange
            var consoleMock             = new Mock <IConsole>();
            var socialNetworkConsoleApp = new SocialNetworkConsoleApp(consoleMock.Object);

            consoleMock.Setup(m => m.ReadLine()).Returns("exit");

            // Act
            socialNetworkConsoleApp.Run();

            // Assert
            consoleMock.Verify(m => m.WriteLine(It.IsAny <string>()), Times.Exactly(2));
        }