コード例 #1
0
ファイル: _FactoryTests.cs プロジェクト: carl-blance/Monopoly
 public void testLuck()
 {
     //create instance of factory
     LuckFactory f = new LuckFactory();
     //create instance from factory
     Luck p = f.create("Luck", true, 50);
     //check that it is right type
     Type t = new Luck().GetType();
     Assert.IsInstanceOf(t, p);
 }
コード例 #2
0
ファイル: _LuckTest.cs プロジェクト: carl-blance/Monopoly
 public void LuckTests_landOn_penality()
 {
     //set luck not to draw card
     Luck luckTest = new Luck("Jim", false, 10);
     Player thePlayer = new Player("Jim");
     thePlayer.setBalance(100);
     Board.access().addPlayer(thePlayer);
     String response = luckTest.landOn(ref thePlayer);
     StringAssert.Contains("has paid", response);
 }