示例#1
0
        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));
        }
示例#2
0
        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);
        }