コード例 #1
0
 public void And_BlueElixir_Supplied_Is_Not_Enough_Throw_DwarfsAngryException()
 {
     Assert.ThrowsException <DwarfsAngryException>(() => BlackElixirFactory.ProduceElixir(1, 200));
     Assert.ThrowsException <DwarfsAngryException>(() => BlackElixirFactory.ProduceElixir(1, 500));
     Assert.ThrowsException <DwarfsAngryException>(() => BlackElixirFactory.ProduceElixir(5, 100));
     Assert.ThrowsException <DwarfsAngryException>(() => BlackElixirFactory.ProduceElixir(2, 100));
 }
コード例 #2
0
 public void And_Gems_Supplied_Are_Not_Enough_Throw_DwarfsAngryException()
 {
     Assert.ThrowsException <InvalidQuantityException>(() => BlackElixirFactory.ProduceElixir(3, 500));
     Assert.ThrowsException <InvalidQuantityException>(() => BlackElixirFactory.ProduceElixir(2, 300));
     Assert.ThrowsException <InvalidQuantityException>(() => BlackElixirFactory.ProduceElixir(15, 501));
     Assert.ThrowsException <InvalidQuantityException>(() => BlackElixirFactory.ProduceElixir(9, 500));
 }
コード例 #3
0
 public void And_Quantities_Supplied_Are_Not_Exact_Multiplication_Of_Them_Throw_InvalidQuantityException()
 {
     Assert.ThrowsException <InvalidQuantityException>(() => BlackElixirFactory.ProduceElixir(2, 1500));
     Assert.ThrowsException <InvalidQuantityException>(() => BlackElixirFactory.ProduceElixir(5, 400));
 }
コード例 #4
0
 public void With_5_Gems_And_200_BlueElixir_Should_Produce_100_BlackElixir()
 {
     Assert.AreEqual(100, BlackElixirFactory.ProduceElixir(5, 200));
 }