Exemple #1
0
    public TestEqpII CreateTestEqpII(bool isInEqpIG, int quantity, System.Type tempType, out IEquippableItemIconConstArg arg)
    {
        IEquippableItemIconConstArg thisArg;
        TestEqpII testEqpII = CreateTestEqpII(quantity, tempType, out thisArg);

        if (isInEqpIG)
        {
            testEqpII.SetIconGroup(Substitute.For <IEquipToolEquipIG>());
        }
        else
        {
            testEqpII.SetIconGroup(Substitute.For <IEquipToolPoolIG>());
        }

        arg = thisArg;
        return(testEqpII);
    }
Exemple #2
0
    public void IsInPoolIG_ThisIGIsEqpToolPoolIG_ReturnsTrue()
    {
        IEquippableItemIconConstArg arg;
        TestEqpII        testEqpII = CreateTestEqpII(out arg);
        IEquipToolPoolIG poolIG    = Substitute.For <IEquipToolPoolIG>();

        testEqpII.SetIconGroup(poolIG);

        Assert.That(testEqpII.IsInPoolIG(), Is.True);
    }
Exemple #3
0
    public void IsEligibleForHover_ThisIsInSourceIG_ThisIsEmpty_ReturnsTrue()
    {
        IEquippableItemIconConstArg arg;
        TestEqpII           testEqpII   = CreateTestEqpII(out arg);
        IEquippableItemIcon pickedEqpII = Substitute.For <IEquippableItemIcon>();
        IIconGroup          thisIG      = Substitute.For <IIconGroup>();

        testEqpII.SetIconGroup(thisIG);
        pickedEqpII.GetIconGroup().Returns(thisIG);
        IItemIconEmptinessStateEngine emptinessStateEngine = arg.emptinessStateEngine;

        emptinessStateEngine.IsEmpty().Returns(true);

        Assert.That(testEqpII.TestIsEligibleForHover(pickedEqpII), Is.True);
    }
Exemple #4
0
    public void IsEligibleForHover_ThisIsInDestIG_ThisIsNotEmpty_ThisDoesNotHaveSameItemTempAsPicked_ReturnsFalse()
    {
        IEquippableItemIconConstArg arg;
        TestEqpII               testEqpII   = CreateTestEqpII(quantity: 1, tempType: typeof(IBowTemplate), arg: out arg);
        IEquippableItemIcon     pickedEqpII = Substitute.For <IEquippableItemIcon>();
        IEquipToolEquippedBowIG thisEqpIG   = Substitute.For <IEquipToolEquippedBowIG>();

        testEqpII.SetIconGroup(thisEqpIG);
        IIconGroup otherIG = Substitute.For <IIconGroup>();

        pickedEqpII.GetIconGroup().Returns(otherIG);
        IItemIconEmptinessStateEngine emptinessStateEngine = arg.emptinessStateEngine;

        emptinessStateEngine.IsEmpty().Returns(false);
        pickedEqpII.GetItemTemplate().Returns(Substitute.For <IWearTemplate>());

        Assert.That(testEqpII.TestIsEligibleForHover(pickedEqpII), Is.False);
    }
Exemple #5
0
    public void IsEligibleForHover_ThisIsInSourceIG_ThisIsNotEmpty_ThisDoesNotHaveSameItemAsPickedEqpII_ReturnsFalse()
    {
        IEquippableItemIconConstArg arg;
        TestEqpII           testEqpII   = CreateTestEqpII(out arg);
        IEquippableItemIcon pickedEqpII = Substitute.For <IEquippableItemIcon>();
        IIconGroup          thisIG      = Substitute.For <IIconGroup>();

        testEqpII.SetIconGroup(thisIG);
        pickedEqpII.GetIconGroup().Returns(thisIG);
        IEquippableUIItem pickedEqpItem = Substitute.For <IEquippableUIItem>();

        pickedEqpII.GetEquippableItem().Returns(pickedEqpItem);
        arg.item.IsSameAs(pickedEqpItem).Returns(false);
        IItemIconEmptinessStateEngine emptinessStateEngine = arg.emptinessStateEngine;

        emptinessStateEngine.IsEmpty().Returns(false);

        Assert.That(testEqpII.TestIsEligibleForHover(pickedEqpII), Is.False);
    }