示例#1
0
        public void GetUsersIntentReturnsOneOrTwo()
        {
            //Arrange
            // not needed

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

            //Assert
            Assert.IsTrue();
        }
示例#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);
                }
            }
        }