Exemplo n.º 1
0
 public WorkItemLinkGenerator(
     Func <T> createFunc,
     IWorkItemLinkType linkType,
     Func <IWorkItemLinkTypeEnd, int, int, ILink> linkFunc)
     : this(createFunc, linkType, linkFunc, null)
 {
 }
Exemplo n.º 2
0
        public override void Given()
        {
            _instance  = WorkItemLinkTypeComparer.Default;
            _instance2 = WorkItemLinkTypeEndComparer.Default;

            _first  = new MockWorkItemLinkType(CoreLinkTypeReferenceNames.Hierarchy);
            _second = new MockWorkItemLinkType(CoreLinkTypeReferenceNames.Hierarchy);
        }
Exemplo n.º 3
0
 public MockWorkItemLinkTypeEnd(IWorkItemLinkType linkType, string name, bool isForward, int id = 0)
     : base(GetValue(linkType, isForward))
 {
     Id            = id;
     LinkType      = linkType ?? throw new ArgumentNullException(nameof(linkType));
     Name          = name ?? throw new ArgumentNullException(nameof(name));
     IsForwardLink = isForward;
 }
Exemplo n.º 4
0
 public WorkItemLinkGenerator(
     Func <T> createFunc,
     IWorkItemLinkType linkType,
     Func <IWorkItemLinkTypeEnd, int, int, ILink> linkFunc,
     IEnumerable <string> propertiesToSkip = null)
     : base(createFunc, propertiesToSkip)
 {
     _linkFunc = linkFunc ?? throw new ArgumentNullException(nameof(linkFunc));
     _linkType = linkType ?? throw new ArgumentNullException(nameof(linkType));
 }
Exemplo n.º 5
0
        private static string GetValue(IWorkItemLinkType linkType, bool isForward)
        {
            if (linkType == null)
            {
                throw new ArgumentNullException(nameof(linkType));
            }
            var referenceName = linkType.ReferenceName;

            if (!linkType.IsDirectional)
            {
                return(referenceName);
            }
            return(referenceName + (isForward ? "-Forward" : "-Reverse"));
        }
 partial void IsOneToMany_SetCondition(ref IWorkItemLinkType instance, ref Boolean setValue);
 partial void IsNonCircular_SetCondition(ref IWorkItemLinkType instance, ref Boolean setValue);
 partial void IsDirectional_SetCondition(ref IWorkItemLinkType instance, ref Boolean setValue);
 partial void ForwardEnd_SetCondition(ref IWorkItemLinkType instance, ref IWorkItemLinkTypeEnd setValue);
 partial void Deactivate_PreCondition(IWorkItemLinkType instance);
 partial void Deactivate_PostValidate(IWorkItemLinkType instance);
Exemplo n.º 12
0
 ///<summary>
 /// Gets the Id for the link type's reverse end.
 /// </summary>
 /// <param name="item">An instance of <see cref="IWorkItemLinkType"/>.</param>
 /// <returns>0 if no link or link type; otherwise, the link type id.</returns>
 /// <seealso cref="IWorkItemLinkTypeEndExtensions"/>
 public static int ReverseEndLinkTypeId(this IWorkItemLinkType item)
 {
     return(item?.ReverseEnd.LinkTypeId() ?? 0);
 }
Exemplo n.º 13
0
 /// <summary>
 ///     Tries the name of the get by.
 /// </summary>
 /// <param name="linkTypeReferenceName">Name of the link type reference.</param>
 /// <param name="linkType">Type of the link.</param>
 /// <returns>Boolean.</returns>
 /// <exception cref="DynCon.OSI.Core.Helpers.ToBeImplementedException"></exception>
 Boolean IWorkItemLinkTypeCollection.TryGetByName(String linkTypeReferenceName, out IWorkItemLinkType linkType)
 {
     throw new ToBeImplementedException();
 }
 partial void LinkTopology_SetCondition(ref IWorkItemLinkType instance, ref IWorkItemLinkType_Topology setValue);
 partial void CanEdit_SetCondition(ref IWorkItemLinkType instance, ref Boolean setValue);
 partial void ReverseEnd_SetCondition(ref IWorkItemLinkType instance, ref IWorkItemLinkTypeEnd setValue);
Exemplo n.º 17
0
 ///<summary>
 /// Gets the Id for the link type's forward end.
 /// </summary>
 /// <param name="item">An instance of <see cref="IWorkItemLinkType"/>.</param>
 /// <returns>0 if no link or link type; otherwise, the link type id.</returns>
 /// <seealso cref="IWorkItemLinkTypeEndExtensions"/>
 public static int ForwardEndLinkTypeId(this IWorkItemLinkType item)
 {
     return(item?.ForwardEnd.LinkTypeId() ?? 0);
 }