Exemplo n.º 1
0
        public void ConvertFilm_EmptyLine_ReturnsNull()
        {
            var merger = new IniConverter ();
            var result = merger.ConvertFilm ("");

            result.ShouldBe (null);
        }
Exemplo n.º 2
0
        public void ConvertBegrip_AnotherIniLine_ReturnsThatBegrip()
        {
            var merger = new IniConverter ();
            var result = merger.ConvertBegrip ("2=Naam2;2");

            var begrip2 = new Begrip (2, "Naam2");
            result.ShouldBe (begrip2);
        }
Exemplo n.º 3
0
        public void ConvertFilm_ValidLine_ReturnsFilm()
        {
            var merger = new IniConverter ();
            var result = merger.ConvertFilm ("1=FileName");

            result.ShouldNotBe (null);
            result.ID.ShouldBe (1);
            result.FileName.ShouldBe ("FileName");
        }
Exemplo n.º 4
0
        public void ConvertBegrip_ActualBegripFile_ReturnsRightAmountOfBegrippen()
        {
            var rdr = new IniFileReader();
            var lines = rdr.Read("begrip_ok.ini");

            var cvt = new IniConverter();
            var begrippen = cvt.ConvertBegrippen(lines);

            begrippen.Count().ShouldBe(654);
        }
Exemplo n.º 5
0
        public void ConvertBegrip_OneIniLine_ReturnsOneBegrip()
        {
            var merger = new IniConverter ();
            var result = merger.ConvertBegrip ("1=Naam;1");

            result.ShouldNotBe (null);

            var expectedBegrip = new Begrip (1, "Naam");
            result.ShouldBe (expectedBegrip);
        }
Exemplo n.º 6
0
        public void ConvertBegrippen_ThreeLines_ReturnsThreeBegrippen()
        {
            var merger = new IniConverter ();
            var iniLines = new string[] {
                "1=Naam1;1",
                "2=Naam2;2",
                "3=Naam3;3"
            };

            var result = merger.ConvertBegrippen (iniLines);
            result.Count.ShouldBe (3);

            var begrip1 = new Begrip (1, "Naam1");
            var begrip2 = new Begrip (2, "Naam2");
            var begrip3 = new Begrip (3, "Naam3");

            result [0].ShouldBe (begrip1);
            result [1].ShouldBe (begrip2);
            result [2].ShouldBe (begrip3);
        }
Exemplo n.º 7
0
partial         void browseDirClicked(MonoMac.Foundation.NSObject sender)
        {
            logger.Debug("Button clicked");

            if (!UserPickedDirectory())
            {
                return;
            }

            if (File.Exists(Path.Combine(this.directory.StringValue, "begrip_ok.ini")))
            {
                File.WriteAllText(this.DvdLocationFile, this.directory.StringValue);

                var rdr = new IniFileReader();
                var iniBegrippen = rdr.Read(Path.Combine(this.directory.StringValue, "begrip_ok.ini"));
                var iniFotos = rdr.Read(Path.Combine(this.directory.StringValue, "begrip_foto_ok.ini"));

                var cvt = new IniConverter();
                var begrippen = cvt.ConvertBegrippen(iniBegrippen);
                var fotos = cvt.ConvertFotos(iniFotos);

                var cmp = new Composer();
                cmp.AddBegrippen(begrippen);
                cmp.AddFotos(fotos);
                var composedBegrippen = cmp.Compose();

            //				logger.Debug("begrip_ok.ini found");
            //				logger.Debug("Converting file");
            //				var converter = new IniMerger(this.directory.StringValue);
            //				converter.LineWasMerged += delegate(object s, IniMerger.LineMergedEventArgs e) {
            //					if (e.LineNumber == 1)
            //					{
            //						this.mergeProgressBar.MaxValue = e.MaxLines;
            //					}
            //					this.mergeProgressBar.DoubleValue = e.LineNumber;
            //					this.mergeProgressBar.Display();
            //				};
            //
            //				var begrippen = converter.MakeBegripXml();
            //				var begrippenText = converter.MakeBegripTxt(begrippen);
            //
            //				File.WriteAllText(this.BegrippenFile, begrippenText);
            //				var begripDefinities = File.ReadAllLines(this.BegrippenFile);
            //				Array.Sort(begripDefinities);
            //
            //				File.WriteAllLines(this.BegrippenFile,begripDefinities);
            //
            //				logger.Debug("Conversion done");
              	//this.begrippenLijst.Source = new BegrippenSource(begripDefinities, this.movieViewer, this.tekeningViewer, this.directory.StringValue, null, null);
            }
        }
Exemplo n.º 8
0
        public void ConvertGebaar_ValidIniLine_ReturnsGebaar()
        {
            var merger = new IniConverter ();
            var result = merger.ConvertGebaar ("1=2;3;handvorm1links;handvorm2links;handvorm1rechts;handvorm2rechts;8;9");

            result.ID.ShouldBe (1);
            result.BegripID.ShouldBe (2);
            result.HandVormEenLinks.ShouldBe ("handvorm1links");
            result.HandVormEenRechts.ShouldBe ("handvorm1rechts");
            result.HandVormTweeLinks.ShouldBe ("handvorm2links");
            result.HandVormTweeRechts.ShouldBe ("handvorm2rechts");
            result.FilmID.ShouldBe (9);
        }