public override void SavePlan()
        {
            PlanFile pf = new PlanFile();

            pf.AddContent(vehicleTypes);
            pf.AddContent(vehicleTypeProducers);
            pf.Save("mandb.plan");
        }
Example #2
0
        public void Save_NonEmptyArray_FileExists()
        {
            PlanFile planFile = new PlanFile();
            Dictionary <string, ITitleLinkPair[]> vehicleTypeProducers = new Dictionary <string, ITitleLinkPair[]>();

            vehicleTypeProducers.Add("Otomobil", new TitleLinkPair[]
            {
                new TitleLinkPair
                {
                    Title = "Acura",
                    Link  = "http://catalog.mann-filter.com/EU/tur/vehicle/MANN-FILTER%20Katalog%20Europa/Ara%C3%A7lar/Otomobiller%20+%20Ticari%20Ara%C3%A7lar/ACURA"
                },
                new TitleLinkPair
                {
                    Title = "Alfa Romeo",
                    Link  = "http://catalog.mann-filter.com/EU/tur/vehicle/MANN-FILTER%20Katalog%20Europa/Ara%C3%A7lar/Otomobiller%20+%20Ticari%20Ara%C3%A7lar/ALFA%20ROMEO"
                },
                new TitleLinkPair
                {
                    Title = "Audi",
                    Link  = "http://catalog.mann-filter.com/EU/tur/vehicle/MANN-FILTER%20Katalog%20Europa/Ara%C3%A7lar/Otomobiller%20+%20Ticari%20Ara%C3%A7lar/AUDI"
                },
                new TitleLinkPair
                {
                    Title = "BMW",
                    Link  = "http://catalog.mann-filter.com/EU/tur/vehicle/MANN-FILTER%20Katalog%20Europa/Ara%C3%A7lar/Otomobiller%20+%20Ticari%20Ara%C3%A7lar/BMW"
                }
            });
            planFile.AddContent(vehicleTypeProducers);

            planFile.Save("Save_NonEmptyArray_FileExists.pf");

            Assert.IsTrue(File.Exists("Save_NonEmptyArray_FileExists.pf"));
        }
Example #3
0
        public void Save_EmptyArray_FileExistsWith648Length()
        {
            PlanFile planFile = new PlanFile();
            Dictionary <string, ITitleLinkPair[]> vehicleTypeProducers = new Dictionary <string, ITitleLinkPair[]>();

            planFile.AddContent(vehicleTypeProducers);
            string fileName = "Save_EmptyArray_FileExistsWithZeroSize.pf";

            planFile.Save(fileName);

            FileInfo f = new FileInfo(fileName);

            Assert.IsTrue(File.Exists(fileName) && f.Length == 648);
        }