Beispiel #1
0
        public void TestLinkTransportMode()
        {
            var mumbai = new City("Mumbai", "India", 12383146, 18.96, 72.82);
            var buenosAires = new City("Buenos Aires", "Argentina", 12116379, -34.61, -58.37);

            var link = new Link(mumbai, buenosAires, 10);
            // verify default transport
            Assert.AreEqual(TransportModes.Car, link.TransportMode);

            link = new Link(mumbai, buenosAires, 10, TransportModes.Ship);
            Assert.AreEqual(TransportModes.Ship, link.TransportMode);
        }
Beispiel #2
0
        public void TestExcelExport()
        {
            var excelFileName = Directory.GetCurrentDirectory() + @"\ExportTest.xlsx";

            var bern = new City("Bern", "Switzerland", 5000, 46.95, 7.44);
            var zuerich = new City("Zürich", "Switzerland", 100000, 32.876174, 13.187507);
            var aarau = new City("Aarau", "Switzerland", 10000, 35.876174, 12.187507);
            var link1 = new Link(bern, aarau, 15, TransportModes.Ship);
            var link2 = new Link(aarau, zuerich, 20, TransportModes.Ship);
            var links = new List<Link>();
            links.Add(link1);
            links.Add(link2);

            var excel = new ExcelExchange();

            var statusMessage = excel.WriteToFile(excelFileName, bern, zuerich, links);
            excel.WriteToFile(excelFileName, bern, zuerich, links);

            Assert.IsTrue(File.Exists(excelFileName), excelFileName + " / " + statusMessage);

        }