Ejemplo n.º 1
0
        public void ReadResourceOrFindDataEndTest1()
        {
            var data       = new KnapsackProblemDataParser();
            var constraint = KnapsackProblemDataParser.ReadResourceOrFindDataEnd("end data", data);

            Assert.AreEqual(KnapsackProblemDataParser.FindSolutionStart, constraint);
        }
Ejemplo n.º 2
0
        public void ReadResourceOrFindDataEndTest2()
        {
            var data       = new KnapsackProblemDataParser();
            var constraint = KnapsackProblemDataParser.ReadResourceOrFindDataEnd("3369\t3712", data);

            Assert.AreEqual(KnapsackProblemDataParser.ReadResourceOrFindDataEnd, constraint);
            Assert.AreEqual("R1", data.Resources[0].Name);
            Assert.AreEqual(3712, data.Resources[0].Value);
            Assert.AreEqual(0, data.Resources[0].Volume);
            Assert.AreEqual(3369, data.Resources[0].Weight);
        }