[Category("Class")]
[Description("Unit Test Framework")]
public FrameworkEnum Framework {
get { return _framework;}
set { _framework = value;}
}
[Editor(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))]
[Category("Mapping")]
[Description("The mapping file to generate the class file from.")]
public string MappingFile {
get { return _mappingFile; }
set {
_mappingFile = value;
if ((_outputDirectory == null || _outputDirectory.Length == 0) && _mappingFile != null)
OutputDirectory = Path.GetDirectoryName(_mappingFile);
}
}
[Editor(typeof(System.Windows.Forms.Design.FolderNameEditor), typeof(System.Drawing.Design.UITypeEditor))]
[Category("Class")]
[Description("The folder to save the generated class files.")]
public string OutputDirectory
{
get {return _outputDirectory;}
set {_outputDirectory = value;}
}
[Category("Class")]
[Description("The Namespace for the test classes.")]
public string TestNamespace
{
get {return _testNamespace;}
set {_testNamespace = value;}
}
[Category("Class")]
[Description("Class Output Language")]
public LangaugeEnum Language {
get { return _language;}
set { _language = value;}
}
[Category("Class")]
[Description("Overwite existing class files with changes")]
public bool Overwrite {
get { return _overwrite;}
set { _overwrite = value;}
}
public void InitializeTemplates()
{
string internalPath = Path.Combine(CodeTemplateInfo.DirectoryName, "Internal");
if (!File.Exists(fileName) || _overwrite)
{
Response.WriteLine(string.Format("Generating Test Case for {0} from Table {1} ...", className, tableName));
_testTemplate.RenderToFile(fileName, true);
Response.WriteLine(string.Format("File {0} Generated...", fileName));
}
}
}
finally
{
// close xml reader
if (reader != null)
reader.Close();
}
}