private EntitySynchronizationMessage MapWorkItemToMessage(
            WorkItemInfo workItemInfo,
            SimpleMappingContainer entitiesMap)
        {
            string tpEntity = entitiesMap[workItemInfo.WorkItemType];

            switch (tpEntity)
            {
            case Constants.Bug:
                return(new BugSynchronizationMessage {
                    WorkItem = workItemInfo
                });

            case Constants.UserStory:
                return(new UserStorySynchronizationMessage {
                    WorkItem = workItemInfo
                });

            case Constants.Feature:
                return(new FeatureSynchronizationMessage {
                    WorkItem = workItemInfo
                });

            case Constants.Request:
                return(new RequestSynchronizationMessage {
                    WorkItem = workItemInfo
                });

            default:
                throw new Exception(string.Format("There is no mapped entity type for {0}", workItemInfo.WorkItemType));
            }
        }
Beispiel #2
0
 public TfsPluginProfile()
 {
     UserMapping          = new MappingContainer();
     EntityMapping        = new SimpleMappingContainer();
     ProjectsMapping      = new MappingContainer();
     SourceControlEnabled = true;
     WorkItemsEnabled     = false;
     StartRevision        = "1";
     StartWorkItem        = "1";
 }
		public TfsPluginProfile()
		{
			UserMapping = new MappingContainer();
			EntityMapping = new SimpleMappingContainer();
			ProjectsMapping = new MappingContainer();
			SourceControlEnabled = true;
			WorkItemsEnabled = false;
			StartRevision = "1";
			StartWorkItem = "1";
		}
        public WorkItemsContext()
        {
            EntityMapping = new SimpleMappingContainer()
            {
                new SimpleMappingElement {
                    First = "Bug", Second = "Bug"
                },
                new SimpleMappingElement {
                    First = "User Story", Second = "User Story"
                },
                new SimpleMappingElement {
                    First = "Task", Second = "Feature"
                },
                new SimpleMappingElement {
                    First = "Issue", Second = "Request"
                }
            };
            ProjectsMapping = new MappingContainer()
            {
                new MappingElement()
                {
                    Key   = ConfigHelper.Instance.TestCollectionProject,
                    Value = new MappingLookup()
                    {
                        Id = 1, Name = "Test"
                    }
                }
            };
            WorkItems      = new List <WorkItem>();
            Uri            = ConfigHelper.Instance.TestCollection;
            Credential     = new NetworkCredential(ConfigHelper.Instance.Login, ConfigHelper.Instance.Password, ConfigHelper.Instance.Domen);
            _tfsCollection = new TfsTeamProjectCollection(new Uri(Uri), Credential);
            _workItemStore = _tfsCollection.GetService <WorkItemStore>();

            ObjectFactory.Configure(x => x.AddRegistry <WorkItemsUnitTestsRegistry>());
            AddReplyForCreateCommand <BugDTO, BugCreatedMessage>(_bugs);
            AddReplyForCreateCommand <UserStoryDTO, UserStoryCreatedMessage>(_userStories);
            AddReplyForCreateCommand <FeatureDTO, FeatureCreatedMessage>(_features);
            AddReplyForCreateCommand <RequestDTO, RequestCreatedMessage>(_requests);

            AddReplyForUpdateCommand <UserStoryDTO, UserStoryField, UserStoryUpdatedMessage>(TpUserStories, UserStoryField.EntityStateID);
        }
Beispiel #5
0
        public static string ToWorkItemsString(this SimpleMappingContainer entityMapping)
        {
            string sequence = entityMapping.Select(x => string.Format("'{0}'", x.First)).ToString(",");

            return(sequence);
        }