public void Item_generate() { var bagSize = 5; var C = 10; var seed = 609; var testBag = new Knapsack(bagSize, C, seed); testBag.GenerateItems(); Assert.AreEqual(testBag.ItemSize, 5); }
public void Test_ValueSum3() { var bagSize = 5; var C = 10; var seed = 609; var testBag = new Knapsack(bagSize, C, seed); testBag.GenerateItems(); testBag.SortTheItems(); testBag.FitTheItemsInTheBag(); testBag.PrintTheBag(); Assert.AreEqual(testBag.ValueSum, 14); }
public void Test_ValueSum1() { var bagSize = 30; var C = 20; var seed = 2137; var testBag = new Knapsack(bagSize, C, seed); testBag.GenerateItems(); testBag.SortTheItems(); testBag.FitTheItemsInTheBag(); testBag.PrintTheBag(); Assert.AreEqual(testBag.ValueSum, 61); }