public void RemainingWeightIndex_After_Guitar(int currentIndex, double expected)
        {
            // Arrange
            var guitar = new Item("guitar", 1500, 1, "$", "pounds");

            // Act
            var actual = _weightsService.GetRemainingWeightIndex(currentIndex, guitar);

            // Assert
            Assert.AreEqual(expected, actual);
        }
Example #2
0
        private void AddItemsToCellInOtherRows(int col, int row)
        {
            var index = _weightsService.GetRemainingWeightIndex(col, _items[row]);

            var addedItems = index >= 0
                ? AddPreviousItemsOrCurrentItemWithRemainingPreviousItems(row, col, index)
                : AddPreviousItemsOrCurrentItem(row, col);

            Table[row, col].AddRange(addedItems);
        }