コード例 #1
0
        public UserAction clickOK([PexAssumeUnderTest] UserActionHandler target, int playerID)
        {
            UserAction result = target.clickOK(playerID);

            return(result);
            // TODO: add assertions to method UserActionHandlerTest.clickOK(UserActionHandler, Int32)
        }
コード例 #2
0
 public void testClickButton(int abili, int userID, int cardID, Type expected)
 {
     try
     {
         UserActionHandler handler = new UserActionHandler(game);
         handler.ClickUser    = userID;
         handler.SelectCardId = cardID;
         handler.Ifabi        = abili;
         UserAction action = handler.clickOK(1);
         if (expected == null)
         {
             Assert.Fail("Should throw an exception");
         }
         Assert.AreEqual(expected, action.GetType());
     }
     catch (InvalidOperationException e) {
         if (expected != null)
         {
             Assert.Fail("Should not throw an exception");
         }
     }
 }