public void SetUp()
 {
     pathToFile        = Environment.CurrentDirectory + "\\Source\\Class.cs";
     asyncReader       = new AsyncFileReader();
     sourceCode        = asyncReader.Read(pathToFile).Result;
     templateGenerator = new TemplateClassGenerator();
     sourceRoot        = CSharpSyntaxTree.ParseText(sourceCode).GetRoot();
 }
        public void WriteAndReadTest()
        {
            asyncWriter.Write(template).Wait();
            string resultStr = asyncReader.Read(pathToFile).Result;

            Assert.IsNotNull(resultStr);
            Assert.AreEqual(testString, resultStr);
            File.Delete(pathToFile);
        }
Exemplo n.º 3
0
        public async Task TestFileReader()
        {
            var reader = new AsyncFileReader(@"D:\work\SchoneData_filtered.xml");

            var    cts     = new CancellationTokenSource();
            string content = await reader.Read(cts.Token).ConfigureAwait(false);

            cts.Cancel();
            Assert.IsNotEmpty(content);
        }
Exemplo n.º 4
0
        public void SetUp()
        {
            pathToFile  = Environment.CurrentDirectory + "\\SourceCodeFiles\\Class.cs";
            asyncReader = new AsyncFileReader();
            string sourceCode = asyncReader.Read(pathToFile).Result;

            syntaxProcessor     = new SyntaxProcessor();
            syntaxProcessResult = syntaxProcessor.Process(sourceCode);

            SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(sourceCode);

            root = syntaxTree.GetRoot();
        }