Ejemplo n.º 1
0
        public string CreateSpecs()
        {
            SpecCount = new TaskItem("0");
            int specCount;
            var config = new ProviderConfig
                {
                    BaseDirectory = BaseDirectory,
                    Extensions = Extensions,
                    Log = Log,
                    MyNamespace = GetType().Namespace,
                    TargetNamespace = Namespace ?? (string.IsNullOrWhiteSpace(ProjectDir) ? GetType().Namespace : (new DirectoryInfo(ProjectDir).Name)),
                    Pattern = Pattern
                };

            var provider = GetProvider(config);
            var result = provider.CreateSpecs(out specCount);
            SpecCount = new TaskItem(specCount.ToString());
            return result;
        }
Ejemplo n.º 2
0
 public CSharpMSpecProvider(ProviderConfig config)
     : base(config)
 {
 }
 public VisualBasicMSpecProvider(ProviderConfig config)
     : base(config)
 {
 }
Ejemplo n.º 4
0
 MSpecCodeProvider GetProvider(ProviderConfig config)
 {
     var language = (Language ?? string.Empty);
     switch (language)
     {
         case "C#":
             return new CSharpMSpecProvider(config);
         case "VB":
             return new VisualBasicMSpecProvider(config);
         default:
             throw new Exception("Language not recognised, supported languages : C# & VB");
     }
 }
Ejemplo n.º 5
0
 protected MSpecCodeProvider(ProviderConfig config)
 {
     this.config = config;
 }