Exemplo n.º 1
0
    public TestEqpToolEqpCGIG CreateEqpToolEqpCarriedGearIG(int minSize, int maxSize, out IIconGroupConstArg arg)
    {
        IIconGroupConstArg thisArg = CreateStubIconGroupConstArg(minSize, maxSize);
        TestEqpToolEqpCGIG ig      = new TestEqpToolEqpCGIG(thisArg);

        arg = thisArg;
        return(ig);
    }
Exemplo n.º 2
0
    public void EqpToolEqpCarriedGearIG_HasItemSpace_WithItemSpace_ItemTempTypeIsCG_ReturnsTrue(int quantInIG, int maxEqpQ)
    {
        IIconGroupConstArg arg;
        TestEqpToolEqpCGIG ig   = CreateEqpToolEqpCarriedGearIG(0, 4, out arg);
        IEquippableUIItem  item = CreateItemWithMaxEqpQAndTemplate(maxEqpQ, typeof(ICarriedGearTemplate));
        List <IItemIcon>   iis  = CreateStubIIsWithItemQuantity(size: 4, quantInIG: quantInIG, item: item);

        ig.SetItemIcons(iis);

        bool actualBool = ig.HasItemSpace(item);

        Assert.That(actualBool, Is.True);
    }
Exemplo n.º 3
0
    public void EqpToolEqpCarriedGearIG_GetDefaultTATargetEqpII_HasNoSameItem_HasEmpty_ReturnsFirstEmpty(int[] emptyAt)
    {
        IIconGroupConstArg  arg;
        TestEqpToolEqpCGIG  ig            = CreateEqpToolEqpCarriedGearIG(0, 4, out arg);
        IEquippableItemIcon pickedEqpII   = Substitute.For <IEquippableItemIcon>();
        IEquippableUIItem   pickedEqpItem = Substitute.For <IEquippableUIItem>();

        pickedEqpII.GetUIItem().Returns(pickedEqpItem);
        List <IItemIcon> iis = CreateStubIIsWithNoMatchAndEmptyAt(4, pickedEqpItem, emptyAt);

        ig.SetItemIcons(iis);

        IEquippableItemIcon actualEqpII   = ig.GetDefaultTATargetEqpII(pickedEqpII);
        IItemIcon           expectedEqpII = iis[emptyAt[0]];

        Assert.That(actualEqpII, Is.SameAs(expectedEqpII));
    }
Exemplo n.º 4
0
    public void EqpToolEqpCarriedGearIG_GetDefaultTATargetEqpII_HasSameItem_ReturnsIt(int[] sameAt)
    {
        IIconGroupConstArg  arg;
        TestEqpToolEqpCGIG  ig            = CreateEqpToolEqpCarriedGearIG(0, 4, out arg);
        IEquippableItemIcon pickedEqpII   = Substitute.For <IEquippableItemIcon>();
        IEquippableUIItem   pickedEqpItem = Substitute.For <IEquippableUIItem>();

        pickedEqpII.GetUIItem().Returns(pickedEqpItem);
        List <IItemIcon> iisContainingSameItem = CreateStubEqpIIsWithSameItemAt(4, pickedEqpItem, sameAt);

        ig.SetItemIcons(iisContainingSameItem);

        IEquippableItemIcon actualEqpII = ig.GetDefaultTATargetEqpII(pickedEqpII);
        IItemIcon           expectedII  = iisContainingSameItem[sameAt[0]];

        Assert.That(actualEqpII, Is.SameAs(expectedII));
    }