Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TfsSink"/> class.
        /// </summary>
        /// <param name="tfsServiceProvider">
        /// Service endpoint.
        /// </param>
        /// <param name="credential">
        /// The credential.
        /// </param>
        /// <param name="parentWorkItem">
        /// Parent work item id for all tasks.
        /// </param>
        /// <param name="fieldMap">Map of work item fields to mail properties.</param>
        protected TfsSink(ITfsServiceProvider tfsServiceProvider, NetworkCredential credential, int parentWorkItem, string workItemType, IDictionary <string, object> fieldMap)
        {
            if (credential == null)
            {
                throw new ArgumentNullException(nameof(credential));
            }

            if (fieldMap == null)
            {
                throw new ArgumentNullException(nameof(fieldMap));
            }

            this.logger = Log.Logger.ForContext <TfsSink>();

            this.tfsServiceProvider = tfsServiceProvider;
            this.fieldMap           = fieldMap;
            this.tfsServiceProviderConfiguration = new TfsServiceProviderConfiguration(credential.UserName, credential.Password)
            {
                ParentWorkItemId = parentWorkItem,
                WorkItemType     = string.IsNullOrEmpty(workItemType) ? "Task" : workItemType
            };
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TfsSink"/> class.
        /// </summary>
        /// <param name="tfsServiceProvider">
        /// Service endpoint.
        /// </param>
        /// <param name="credential">
        /// The credential.
        /// </param>
        /// <param name="parentWorkItem">
        /// Parent work item id for all tasks.
        /// </param>
        /// <param name="fieldMap">Map of work item fields to mail properties.</param>
        protected TfsSink(ITfsServiceProvider tfsServiceProvider, NetworkCredential credential, int parentWorkItem, string workItemType, IDictionary<string, object> fieldMap)
        {
            if (credential == null)
            {
                throw new ArgumentNullException(nameof(credential));
            }

            if (fieldMap == null)
            {
                throw new ArgumentNullException(nameof(fieldMap));
            }

            this.logger = Log.Logger.ForContext<TfsSink>();

            this.tfsServiceProvider = tfsServiceProvider;
            this.fieldMap = fieldMap;
            this.tfsServiceProviderConfiguration = new TfsServiceProviderConfiguration(credential.UserName, credential.Password)
            {
                ParentWorkItemId = parentWorkItem,
                WorkItemType = string.IsNullOrEmpty(workItemType) ? "Task" : workItemType
            };
        }
 public void InitializeTest()
 {
     // Reset the connection state at start of test
     this.tfsServiceProvider = this.CreateTfsServiceProvider();
     this.tfsServiceProviderDefaultConfig = this.CreateDefaultConfiguration();
 }
Exemple #4
0
 public TestableTfsSink(ITfsServiceProvider serviceProvider, NetworkCredential credential, int parentWorkItemId, string workItemType, Dictionary <string, object> fieldMap)
     : base(serviceProvider, credential, parentWorkItemId, workItemType, fieldMap)
 {
 }
 public void InitializeTest()
 {
     // Reset the connection state at start of test
     this.tfsServiceProvider = this.CreateTfsServiceProvider();
     this.tfsServiceProviderDefaultConfig = this.CreateDefaultConfiguration();
 }
Exemple #6
0
 public TestableTfsSink(ITfsServiceProvider serviceProvider, NetworkCredential credential, int parentWorkItemId, string workItemType, Dictionary<string, object> fieldMap)
     : base(serviceProvider, credential, parentWorkItemId, workItemType, fieldMap)
 {
 }