public void HasSlotSpace_CurSizeEqualToMasSize_NoEmtpyIIs_ReturnsFalse(int iisCount, int[] emptyAt) { IIconGroupConstArg arg; TestIG testIG = CreateTestIG(iisCount, iisCount, out arg); List <IItemIcon> iis = CreateStubItemIcons(iisCount, emptyAt); testIG.SetItemIcons(iis); bool actualBool = testIG.HasSlotSpace(); Assert.That(actualBool, Is.False); }
public void HasSlotSpace_CurSizeLessThanMaxSize_ReturnsTrue(int iisSize, int maxSize) { IIconGroupConstArg arg; TestIG testIG = CreateTestIG(iisSize, maxSize, out arg); List <IItemIcon> iis = CreateStubItemIcons(iisSize); testIG.SetItemIcons(iis); bool actualBool = testIG.HasSlotSpace(); Assert.That(actualBool, Is.True); }
public void GetAllItemIconWithItemTemplate_NoMatch_ReturnsEmptyList(int[] quantities, int[] sameAt) { IIconGroupConstArg arg; TestIG testIG = CreateTestIG(quantities.Length, quantities.Length, out arg); IItemTemplate sourceItemTemp = Substitute.For <IItemTemplate>(); List <IItemIcon> iis = CreateStubItemIconsWithItemTempsMatchingAt(quantities, sameAt, sourceItemTemp); testIG.SetItemIcons(iis); List <IItemIcon> actualIIs = testIG.GetAllItemIconWithItemTemplate(sourceItemTemp); Assert.That(actualIIs, Is.Empty); }
public void GetItemIconFromItem_MoreThanOneMatch_ReturnsFirstMatch(int[] quantities, int[] sameAt) { IIconGroupConstArg arg; TestIG testIG = CreateTestIG(quantities.Length, quantities.Length, out arg); IUIItem sourceItem = Substitute.For <IUIItem>(); List <IItemIcon> iis = CreateStubIIsWithItemsMatchingAt(quantities, sourceItem, sameAt); testIG.SetItemIcons(iis); IItemIcon actualII = testIG.GetItemIconFromItem(sourceItem); Assert.That(actualII, Is.EqualTo(iis[sameAt[0]])); }
public void GetItemQuantity_WhenCalled_ReturnsSumOfAllSameItemQuantity(int[] quantities, int[] sameAt, int expectedQuantity) { IIconGroupConstArg arg; TestIG testIG = CreateTestIG(quantities.Length, quantities.Length, out arg); IUIItem sourceItem = Substitute.For <IUIItem>(); List <IItemIcon> iis = CreateStubIIsWithItemsMatchingAt(quantities, sourceItem, sameAt); testIG.SetItemIcons(iis); int actualQuantity = testIG.GetItemQuantity(sourceItem); Assert.That(actualQuantity, Is.EqualTo(expectedQuantity)); }
public void GetAllItemIconWithItemTemplate_Matches_ReturnsAllMatches(int[] quantities, int[] sameAt) { IIconGroupConstArg arg; TestIG testIG = CreateTestIG(quantities.Length, quantities.Length, out arg); IItemTemplate sourceItemTemp = Substitute.For <IItemTemplate>(); List <IItemIcon> iis = CreateStubItemIconsWithItemTempsMatchingAt(quantities, sameAt, sourceItemTemp); testIG.SetItemIcons(iis); List <IItemIcon> actualIIs = testIG.GetAllItemIconWithItemTemplate(sourceItemTemp); List <IItemIcon> expectedIIs = new List <IItemIcon>(); foreach (int i in sameAt) { expectedIIs.Add(iis[i]); } Assert.That(actualIIs, Is.EquivalentTo(expectedIIs)); }