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); }
public void ExcecuteTransaction_ThisEIIToUnequipIsNotNull_ThisEIIToUnequipIsSameAsPickedEqpII_CallsItImmigrateToPool() { IEqpIITAMConstArg arg; TestEqpIITAM testEqpIITAM = CreateTestEqpIITAM(out arg); IEquippableItemIcon eii = Substitute.For <IEquippableItemIcon>(); testEqpIITAM.SetEIIToUnequip(eii); Assert.That(testEqpIITAM.GetEIIToUnequip(), Is.SameAs(eii)); testEqpIITAM.SetPickedII(eii); Assert.That(testEqpIITAM.GetPickedEqpII(), Is.SameAs(testEqpIITAM.GetEIIToUnequip())); IEquipToolPoolIG poolIG = arg.eqpToolIGManager.GetRelevantPoolIG(); testEqpIITAM.ExecuteTransaction(); eii.Received(1).TravelTransfer(poolIG); }
public void IsEligibleForHover_ThisIsInDestIG_ThisIsNotEmpty_ThisHasSameItemTempAsPicked_ThisIsInPoolIG_ThisIsNotTransferable_ReturnsFalse() { IEquippableItemIconConstArg arg; TestEqpII testEqpII = CreateTestEqpII(quantity: 1, tempType: typeof(IBowTemplate), arg: out arg); IEquippableItemIcon pickedEqpII = Substitute.For <IEquippableItemIcon>(); IEquipToolPoolIG thisPoolIG = Substitute.For <IEquipToolPoolIG>(); testEqpII.SetIconGroup(thisPoolIG); IIconGroup otherIG = Substitute.For <IIconGroup>(); pickedEqpII.GetIconGroup().Returns(otherIG); IItemIconEmptinessStateEngine emptinessStateEngine = arg.emptinessStateEngine; emptinessStateEngine.IsEmpty().Returns(false); pickedEqpII.GetItemTemplate().Returns(Substitute.For <IBowTemplate>()); testEqpII.UpdateTransferableQuantity(1); Assert.That(testEqpII.IsTransferable(), Is.False); Assert.That(testEqpII.TestIsEligibleForHover(pickedEqpII), Is.False); }
public override List <IIconGroup> GetAllRelevantIGs(IItemIcon pickedII) { List <IIconGroup> result = new List <IIconGroup>(); IEquipToolPoolIG relevPoolIG = GetRelevantPoolIG(); result.Add(relevPoolIG); if (pickedII != null) { IEquipToolEquipIG relevEqpIG = GetRelevantEquipIG((IEquippableItemIcon)pickedII); result.Add(relevEqpIG); } else { List <IEquipToolEquipIG> allRelevantEqpIGs = GetAllRelevantEquipIGs(); foreach (IEquipToolEquipIG eqpIG in allRelevantEqpIGs) { result.Add(eqpIG); } } return(result); }
public IEquipToolIGManager CreateStubEqpToolIGManager() { IEquipToolIGManager eqpToolIGManager = Substitute.For <IEquipToolIGManager>(); IEquipToolPoolIG poolIG = Substitute.For <IEquipToolPoolIG>(); IEquipToolEquippedBowIG equippedBowIG = Substitute.For <IEquipToolEquippedBowIG>(); IEquipToolEquippedWearIG equippedWearIG = Substitute.For <IEquipToolEquippedWearIG>(); IEquipToolEquippedCarriedGearsIG equippedCGearsIG = Substitute.For <IEquipToolEquippedCarriedGearsIG>(); eqpToolIGManager.GetRelevantPoolIG().Returns(poolIG); eqpToolIGManager.GetRelevantEquippedBowIG().Returns(equippedBowIG); eqpToolIGManager.GetRelevantEquippedWearIG().Returns(equippedWearIG); eqpToolIGManager.GetRelevantEquippedCarriedGearsIG().Returns(equippedCGearsIG); eqpToolIGManager.GetRelevantEquipIG(Arg.Any <IEquippableItemIcon>()).Returns(Substitute.For <IEquipToolEquipIG>()); List <IEquipToolEquipIG> allEquipIGs = new List <IEquipToolEquipIG>(new IEquipToolEquipIG[] { equippedBowIG, equippedWearIG, equippedCGearsIG }); eqpToolIGManager.GetAllRelevantEquipIGs().Returns(allEquipIGs); return(eqpToolIGManager); }