public bool TryGetLinkInfo(string rel, out ILinkInfo link)
        {
            Contract.Requires(String.IsNullOrWhiteSpace(rel) == false);

            link = this.Collection.SingleOrDefault(x => x.Rel == rel);
            return(link != null);
        }
        public LinkBase( IApplicationInfo appInfo, 
                         ILinkInfo linkInfo, 
                         PathVariablesDTO pathVariablesDTO )
        {
            this._linkInfo = linkInfo;
            this._pathVariablesDTO = pathVariablesDTO;
            this._symLinkHelper = new SymbolicLinkHelper();

            Initialize( appInfo );
        }
        // PUBLIC METHODS ///////////////////////////////////////////////////
        #region Assert Methods
        public static void Equal(ILinkInfo expected, ILinkInfo actual)
        {
            if (expected == null)
            {
                Assert.Null(actual);
                return;
            }
            Assert.NotNull(actual);

            Assert.Equal(expected.Rel, actual.Rel);
        }
 public ILink Get( IApplicationInfo appInfo, 
                   ILinkInfo linkInfo, 
                   PathVariablesDTO pathVariablesDTO )
 {
     var linkParamsDTO = new LinkParametersDTO
     {
         ApplicationInfo = appInfo,
         LinkInfo = linkInfo,
         PathVariablesDTO = pathVariablesDTO
     };
     return this.Get( linkParamsDTO );
 }
 public static LinkType GetLinkType(this ILinkInfo link)
 {
     if (link is NeuralLinkModel)
     {
         return(LinkType.NeuralLink);
     }
     else if (link is NeuralActionModel)
     {
         return(LinkType.ActionLink);
     }
     else
     {
         return(LinkType.NeuralResource);
     }
 }
        public void MarkLinkToDelete_UnitTest()
        {
            ILinkInfo linkInfo    = default(ILinkInfo);
            Object    updatedItem = default(Object);

            ExecuteMethod(
                () => { return((IWorkItemLinkData)GetInstance()); },
                instance =>
            {
                linkInfo    = LinkInfoWrapper_UnitTests.GetInstance();
                updatedItem = new Object();
                MarkLinkToDelete_PreCondition(instance, ref linkInfo, ref updatedItem);
            },
                instance => { instance.MarkLinkToDelete(linkInfo, updatedItem); },
                instance => { MarkLinkToDelete_PostValidate(instance, linkInfo, updatedItem); });
        }
        public void AddLinkInfo_UnitTest()
        {
            ILinkInfo linkInfo    = default(ILinkInfo);
            Object    updatedItem = default(Object);

            ExecuteMethod(
                () => { return((IWorkItemLinkData)GetInstance()); },
                instance =>
            {
                linkInfo    = LinkInfoImpl_UnitTests.GetInstance();
                updatedItem = new Object();
                AddLinkInfo_PreCondition(instance, ref linkInfo, ref updatedItem);
            },
                instance => { instance.AddLinkInfo(linkInfo, updatedItem); },
                instance => { AddLinkInfo_PostValidate(instance, linkInfo, updatedItem); });
        }
        public void SetLinkComment_UnitTest()
        {
            ILinkInfo linkInfo = default(ILinkInfo);
            String    value    = default(String);

            ExecuteMethod(
                () => { return((IWorkItemLinkData)GetInstance()); },
                instance =>
            {
                linkInfo = LinkInfoImpl_UnitTests.GetInstance();
                value    = default(String);  //No Constructor
                SetLinkComment_PreCondition(instance, ref linkInfo, ref value);
            },
                instance => { instance.SetLinkComment(linkInfo, value); },
                instance => { SetLinkComment_PostValidate(instance, linkInfo, value); });
        }
Beispiel #9
0
 partial void AuthorizedRemovedDate_SetCondition(ref ILinkInfo instance, ref DateTime setValue);
 /// <summary>
 ///     Adds the link information.
 /// </summary>
 /// <param name="linkInfo">The link information.</param>
 /// <param name="updatedItem">The updated item.</param>
 /// <exception cref="DynCon.OSI.Core.Helpers.ToBeImplementedException"></exception>
 void IWorkItemLinkData.AddLinkInfo(ILinkInfo linkInfo, Object updatedItem)
 {
     throw new ToBeImplementedException();
 }
 /// <summary>
 ///     Sets the link comment.
 /// </summary>
 /// <param name="linkInfo">The link information.</param>
 /// <param name="value">The value.</param>
 /// <exception cref="DynCon.OSI.Core.Helpers.ToBeImplementedException"></exception>
 void IWorkItemLinkData.SetLinkComment(ILinkInfo linkInfo, String value)
 {
     throw new ToBeImplementedException();
 }
 /// <summary>
 ///     Marks the link to delete.
 /// </summary>
 /// <param name="linkInfo">The link information.</param>
 /// <param name="updatedItem">The updated item.</param>
 /// <exception cref="DynCon.OSI.Core.Helpers.ToBeImplementedException"></exception>
 void IWorkItemLinkData.MarkLinkToDelete(ILinkInfo linkInfo, Object updatedItem)
 {
     throw new ToBeImplementedException();
 }
Beispiel #13
0
 /// <summary>
 ///     Submits the specified li.
 /// </summary>
 /// <param name="li">The li.</param>
 /// <exception cref="DynCon.OSI.Core.Helpers.ToBeImplementedException"></exception>
 void ILinkUpdate.Submit(ILinkInfo li)
 {
     throw new ToBeImplementedException();
 }
 partial void MarkLinkToDelete_PreCondition(IWorkItemLinkData instance, ref ILinkInfo linkInfo, ref Object updatedItem);
 partial void MarkLinkToDelete_PostValidate(IWorkItemLinkData instance, ILinkInfo linkInfo, Object updatedItem);
 partial void AddLinkInfo_PreCondition(IWorkItemLinkData instance, ref ILinkInfo linkInfo, ref Object updatedItem);
 partial void AddLinkInfo_PostValidate(IWorkItemLinkData instance, ILinkInfo linkInfo, Object updatedItem);
Beispiel #18
0
 partial void Comment_SetCondition(ref ILinkInfo instance, ref String setValue);
Beispiel #19
0
 partial void FieldId_SetCondition(ref ILinkInfo instance, ref Int32 setValue);
Beispiel #20
0
        public void TestResourceTypeTryGetLinkInfo(string name, bool attributeExists, IResourceType resourceType, string clrPropertyName, ILinkInfo expected)
        {
            this.Output.WriteLine("Test Name: {0}", name);
            this.Output.WriteLine(String.Empty);

            // Arrange

            // Act
            ILinkInfo actual;
            var       actualExists = resourceType.TryGetLinkInfo(clrPropertyName, out actual);

            // Assert
            if (!attributeExists)
            {
                Assert.False(actualExists);
                Assert.Null(actual);
                return;
            }

            Assert.True(actualExists);
            Assert.NotNull(actual);
            LinkInfoAssert.Equal(expected, actual);
        }
 partial void SetLinkComment_PostValidate(IWorkItemLinkData instance, ILinkInfo linkInfo, String value);
Beispiel #22
0
 public bool TryGetLinkInfo(string rel, out ILinkInfo linkInfo)
 {
     linkInfo = null;
     return(this.LinksInfo != null && this.LinksInfo.TryGetLinkInfo(rel, out linkInfo));
 }
Beispiel #23
0
        public void TestResourceTypeGetLinkInfo(string name, bool linkExists, IResourceType resourceType, string rel, ILinkInfo expected)
        {
            this.Output.WriteLine("Test Name: {0}", name);
            this.Output.WriteLine(String.Empty);

            // Arrange

            // Act
            if (!linkExists)
            {
                Assert.Throws <ServiceModelException>(() => resourceType.GetLinkInfo(rel));
                return;
            }
            var actual = resourceType.GetLinkInfo(rel);

            // Assert
            LinkInfoAssert.Equal(expected, actual);
        }
 partial void SetLinkComment_PreCondition(IWorkItemLinkData instance, ref ILinkInfo linkInfo, ref String value);