public string ToFormattedString() { var sb = new StringBuilder(); var allCode = sb .Append(Usings) .Append("using Xunit;") .Append("using FluentAssertions;") .Append("namespace " + NameSpace) .Append("{\n") .Append(String.Join(String.Empty, ConvertedClasses)) .Append("}") .ToString(); return(TestConverter.Prettify(allCode)); }
static List <string> ConvertClasses(List <TestMetaData> testMetaData) { var classesToWrite = new List <string>(); foreach (var metaData in testMetaData) { if (metaData.IsTest()) { classesToWrite.Add(TestConverter.ConvertTest(metaData)); } else if (metaData.IsTestBaseClass()) { classesToWrite.Add(TestConverter.ConvertTestBase(metaData)); } else { classesToWrite.Add("public " + metaData.Syntax.ToString()); } } return(classesToWrite); }