Exemple #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;
        }
 public CSharpMSpecProvider(ProviderConfig config)
     : base(config)
 {
 }
 public VisualBasicMSpecProvider(ProviderConfig config)
     : base(config)
 {
 }
Exemple #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");
     }
 }
 protected MSpecCodeProvider(ProviderConfig config)
 {
     this.config = config;
 }