Пример #1
0
        private static void SaveAsTest(string usecase)
        {
            SGFTree actual;

            //deserialize data
            using (var stream = GetUseCases(usecase))
            {
                var excepted = SgfReader.LoadFromStream(stream);
                //read
                var gogame = SgfCompiler.Compile(excepted);

                //build
                actual = new GoSgfBuilder(gogame).ToSGFTree();
            }

            //Check with fs
            SaveActual(usecase, actual);

            //Check with Sgf models
            using (var stream = GetUseCases(usecase))
            {
                var excepted = SgfReader.LoadFromStream(stream);
                CompareSgfHelper.CompareNode(excepted.ChildNodes[0], actual, ""); //TODO Algorithm Style  - Remove useless First Node?! see SgfCompiler.Compile
            }
        }
Пример #2
0
 private static GoGame OpenFile(string path)
 {
     using (var stream = File.OpenRead(path))
     {
         var excepted = SgfReader.LoadFromStream(stream);
         return(SgfCompiler.Compile(excepted));
     }
 }