Ejemplo n.º 1
0
        public void Setup(TestContext context)
        {
            var cardTypeHelperMock = new Mock <ICardTypeHelper>();

            cardTypeHelperMock.Setup(helper =>
                                     helper.IsElement(It.IsAny <CardType>()))
            .Returns((CardType type) => (type == fire));

            cardTypeHelperMock.Setup(helper =>
                                     helper.IsUnit(It.IsAny <CardType>()))
            .Returns((CardType type) => (type == rock || type == magma));

            cardTypeHelperMock.Setup(helper =>
                                     helper.IsBaseUnit(It.IsAny <CardType>()))
            .Returns((CardType type) => (type == rock));

            cardTypeHelperMock.Setup(helper =>
                                     helper.IsUpgradedUnit(It.IsAny <CardType>()))
            .Returns((CardType type) => (type == magma));

            cardTypeHelperMock.Setup(helper =>
                                     helper.DoesElementDestroy(It.IsAny <CardType>(), It.IsAny <CardType>()))
            .Returns((CardType element, CardType type) =>
                     (element == water && type == rock));

            cardTypeHelperMock.Setup(helper =>
                                     helper.DoesUnitDestroy(It.IsAny <CardType>(), It.IsAny <CardType>()))
            .Returns((CardType attacker, CardType type) =>
                     (attacker == magma && type == rock));

            cardTypeHelperMock.Setup(helper =>
                                     helper.DoesElementUpgrade(It.IsAny <CardType>(), It.IsAny <CardType>()))
            .Returns((CardType element, CardType type) =>
                     (element == magma && type == rock));

            cardTypeHelperMock.Setup(helper =>
                                     helper.GetBaseUnit(It.IsAny <CardType>()))
            .Returns((CardType type) => rock);

            cardTypeHelperMock.Setup(helper =>
                                     helper.GetBaseUnit(It.IsAny <CardType>()))
            .Returns((CardType type) => fire);

            cardTypeHelper = cardTypeHelperMock.Object;
            Card.SetCardTypeHelper(cardTypeHelperMock.Object);
        }
Ejemplo n.º 2
0
 public static void SetCardTypeHelper(ICardTypeHelper helper) =>
 cardTypeHelper = helper;