Ejemplo n.º 1
0
 public static FixtureModel ReadFrom(string text)
 {
     using (var reader = new FixtureReader(new StringReader(text)))
     {
         return(reader.Read());
     }
 }
Ejemplo n.º 2
0
 public static FixtureModel ReadFromFile(string file)
 {
     using (var stream = new FileStream(file, FileMode.Open))
         using (var streamReader = new StreamReader(stream))
             using (var reader = new FixtureReader(streamReader))
             {
                 return(reader.Read());
             }
 }
Ejemplo n.º 3
0
        public static FixtureModel ReadFromFile(string file)
        {
            using (var stream = new FileStream(file, FileMode.Open))
            {
                using (var streamReader = new StreamReader(stream))
                {
                    using (var reader = new FixtureReader(streamReader))
                    {
                        var fixture = reader.Read();
                        fixture.key = Path.GetFileNameWithoutExtension(file);

                        return(fixture);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public static FixtureLibrary LoadFromPath(string path)
        {
            var fixturePaths = Directory.GetFiles(path)
                               .Where(file =>
                                      Path.GetExtension(file).Equals(
                                          ".md",
                                          StringComparison.OrdinalIgnoreCase));

            var lib = new FixtureLibrary();

            foreach (var fp in fixturePaths)
            {
                var fixture = FixtureReader.ReadFrom(File.ReadAllText(fp));
                lib.Models[fixture.key] = fixture;
            }

            return(lib);
        }