public void TestSerializeRewriteCodeFolder() { var rc = new RewriteCodeFolder(".", "*.cs"); var text = rc.SerializeMe(); var newClass = RewriteAction.UnSerializeMe(text) as RewriteCodeFolder; Assert.IsNotNull(newClass); //File.WriteAllText("a.txt", text); //Process.Start("notepad.exe", "a.txt"); Assert.AreEqual(rc.FolderName, newClass.FolderName); }
public void TestSerializeRewriteCodeFolderFormatter() { var rc = new RewriteCodeFolder(".", "*.cs"); rc.Formatter.FormatterFirstLine = "System.Console.WriteLine('andrei ignat')"; var text = rc.SerializeMe(); var newClass = RewriteAction.UnSerializeMe(text) as RewriteCodeFolder; Assert.IsNotNull(newClass); //File.WriteAllText("a.txt", text); //Process.Start("notepad.exe", "a.txt"); rc.Formatter.FormatterFirstLine.ShouldBe(newClass.Formatter.FormatterFirstLine); }