public void Read_FilmFile_HasRightAmountOfLines() { var rdr = new IniFileReader(); rdr.Read("film_ok.ini"); rdr.LineCount().ShouldBe(1314); }
public void Read_BegripFile_HasRightAmountOfLines() { var rdr = new IniFileReader(); rdr.Read("begrip_ok.ini"); rdr.LineCount().ShouldBe(654); }
public void Read_ActualFile_IgnoresMetaData() { var rdr = new IniFileReader(); var lines = rdr.Read("begrip_ok.ini"); lines.Where(l => l.ToLower() == "[fields]" || l.ToLower() == "[data]").Count().ShouldBe(0); }
public void Read_EmptyFile_HoldsNoLines() { var rdr = new IniFileReader(); File.WriteAllText("file.ini", ""); rdr.Read("file.ini"); rdr.LineCount().ShouldBe(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); }
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); } }
public void ReadFile_NonExistingFile_Throws() { var rdr = new IniFileReader(); Should.Throw<IniFileReader.FileNotFound>(() => rdr.Read("")); }