Пример #1
0
        /// <summary>
        /// Generates test data out of trace
        /// </summary>
        /// <param name="trace">Trace instance</param>
        /// <param name="className">Desired trace class name</param>
        /// <param name="ns">Desired trace namespace</param>
        /// <param name="setup">Test data generator setup</param>
        /// <returns>Generated output</returns>
        public static GenerationOutput GenerateData(this Trace trace, string className, string ns, Action <CSharpTestDataGeneratorSetup> setup = null)
        {
            var tc = CSharpTestDataGeneratorSetup.Create(className, ns);

            setup?.Invoke(tc);

            var r = new CSharpCodeTestDataGenerator(tc);

            r.Proceed(trace.Queries);

            return(new GenerationOutput(r));
        }
Пример #2
0
        /// <summary>
        /// Generates test data out of trace
        /// </summary>
        /// <param name="trace">Trace instance</param>
        /// <param name="className">Desired trace class name</param>
        /// <param name="ns">Desired trace namespace</param>
        /// <param name="setup">Test data generator setup</param>
        /// <returns>Generated output</returns>
        public static GenerationOutput GenerateData(this Trace trace, string className, string ns, Action <CSharpTestDataGeneratorSetup> setup = null)
        {
            if (trace.IsLightTrace)
            {
                throw new TectureException("Cannot capture test data using light trace");
            }

            var tc = CSharpTestDataGeneratorSetup.Create(className, ns);

            setup?.Invoke(tc);

            var r = new CSharpCodeTestDataGenerator(tc);

            r.Proceed(trace.Queries);

            return(new GenerationOutput(r));
        }