public void GetUsersIntentReturnsOneOrTwo()
        {
            //Arrange
            // not needed

            //Act
            int result = RpsGameMethods.GetUsersIntent();

            //Assert
            Assert.IsTrue();
        }
Exemple #2
0
        public void GetUsersIntentReturnOneOrTwo()
        {
            //Arrange
            //not needed


            //Act
            int result = RpsGameMethods.GetUsersIntent();

            //Assert
            using (var sw = new StringWriter())
            {
                using (var sr = new StringReader("2"))
                {
                    Console.SetOut(sw);
                    Console.SetIn(sr);
                    int intent = RpsGameMethods.GetUsersIntent();
                    Assert.Equal(2, intent);
                }
            }
        }