Exemple #1
0
        private TVItemInfrastructureTypeTVItemLink GetFilledRandomTVItemInfrastructureTypeTVItemLink(string OmitPropName)
        {
            TVItemInfrastructureTypeTVItemLink tvItemInfrastructureTypeTVItemLink = new TVItemInfrastructureTypeTVItemLink();

            if (OmitPropName != "InfrastructureType")
            {
                tvItemInfrastructureTypeTVItemLink.InfrastructureType = (InfrastructureTypeEnum)GetRandomEnumType(typeof(InfrastructureTypeEnum));
            }
            // should implement a Range for the property SeeOtherMunicipalityTVItemID and type TVItemInfrastructureTypeTVItemLink
            if (OmitPropName != "InfrastructureTypeText")
            {
                tvItemInfrastructureTypeTVItemLink.InfrastructureTypeText = GetRandomString("", 5);
            }
            //CSSPError: property [TVItem] and type [TVItemInfrastructureTypeTVItemLink] is  not implemented
            //CSSPError: property [TVItemLinkList] and type [TVItemInfrastructureTypeTVItemLink] is  not implemented
            //CSSPError: property [FlowTo] and type [TVItemInfrastructureTypeTVItemLink] is  not implemented

            return(tvItemInfrastructureTypeTVItemLink);
        }
        public void TVItemInfrastructureTypeTVItemLink_Every_Property_Has_Get_Set_Test()
        {
            InfrastructureTypeEnum val1 = (InfrastructureTypeEnum)3;

            tVItemInfrastructureTypeTVItemLink.InfrastructureType = val1;
            Assert.AreEqual(val1, tVItemInfrastructureTypeTVItemLink.InfrastructureType);
            int val2 = 45;

            tVItemInfrastructureTypeTVItemLink.SeeOtherMunicipalityTVItemID = val2;
            Assert.AreEqual(val2, tVItemInfrastructureTypeTVItemLink.SeeOtherMunicipalityTVItemID);
            string val3 = "Some text";

            tVItemInfrastructureTypeTVItemLink.InfrastructureTypeText = val3;
            Assert.AreEqual(val3, tVItemInfrastructureTypeTVItemLink.InfrastructureTypeText);
            TVItem val4 = new TVItem();

            tVItemInfrastructureTypeTVItemLink.TVItem = val4;
            Assert.AreEqual(val4, tVItemInfrastructureTypeTVItemLink.TVItem);
            List <TVItemLink> val5 = new List <TVItemLink>()
            {
                new TVItemLink(), new TVItemLink()
            };

            tVItemInfrastructureTypeTVItemLink.TVItemLinkList = val5;
            Assert.AreEqual(val5, tVItemInfrastructureTypeTVItemLink.TVItemLinkList);
            TVItemInfrastructureTypeTVItemLink val6 = new TVItemInfrastructureTypeTVItemLink();

            tVItemInfrastructureTypeTVItemLink.FlowTo = val6;
            Assert.AreEqual(val6, tVItemInfrastructureTypeTVItemLink.FlowTo);
            bool val7 = true;

            tVItemInfrastructureTypeTVItemLink.HasErrors = val7;
            Assert.AreEqual(val7, tVItemInfrastructureTypeTVItemLink.HasErrors);
            IEnumerable <ValidationResult> val24 = new List <ValidationResult>()
            {
                new ValidationResult("First CSSPError Message")
            }.AsEnumerable();

            tVItemInfrastructureTypeTVItemLink.ValidationResults = val24;
            Assert.AreEqual(val24, tVItemInfrastructureTypeTVItemLink.ValidationResults);
        }
        /// <summary>
        /// Validate function for all TVItemInfrastructureTypeTVItemLinkService commands
        /// </summary>
        /// <param name="validationContext">System.ComponentModel.DataAnnotations.ValidationContext (Describes the context in which a validation check is performed.)</param>
        /// <param name="actionDBType">[ActionDBTypeEnum] (CSSPEnums.ActionDBTypeEnum.html) action type to validate</param>
        /// <returns>IEnumerable of ValidationResult (Where ValidationResult is a container for the results of a validation request.)</returns>
        private IEnumerable <ValidationResult> Validate(ValidationContext validationContext, ActionDBTypeEnum actionDBType)
        {
            string retStr = "";
            Enums  enums  = new Enums(LanguageRequest);
            TVItemInfrastructureTypeTVItemLink tvItemInfrastructureTypeTVItemLink = validationContext.ObjectInstance as TVItemInfrastructureTypeTVItemLink;

            tvItemInfrastructureTypeTVItemLink.HasErrors = false;

            retStr = enums.EnumTypeOK(typeof(InfrastructureTypeEnum), (int?)tvItemInfrastructureTypeTVItemLink.InfrastructureType);
            if (!string.IsNullOrWhiteSpace(retStr))
            {
                tvItemInfrastructureTypeTVItemLink.HasErrors = true;
                yield return(new ValidationResult(string.Format(CSSPServicesRes._IsRequired, "InfrastructureType"), new[] { "InfrastructureType" }));
            }

            //SeeOtherMunicipalityTVItemID has no Range Attribute

            if (!string.IsNullOrWhiteSpace(tvItemInfrastructureTypeTVItemLink.InfrastructureTypeText) && tvItemInfrastructureTypeTVItemLink.InfrastructureTypeText.Length > 100)
            {
                tvItemInfrastructureTypeTVItemLink.HasErrors = true;
                yield return(new ValidationResult(string.Format(CSSPServicesRes._MaxLengthIs_, "InfrastructureTypeText", "100"), new[] { "InfrastructureTypeText" }));
            }

            //CSSPError: Type not implemented [TVItem] of type [TVItem]

            //CSSPError: Type not implemented [TVItem] of type [TVItem]
            //CSSPError: Type not implemented [TVItemLinkList] of type [List`1]

            //CSSPError: Type not implemented [TVItemLinkList] of type [TVItemLink]
            //CSSPError: Type not implemented [FlowTo] of type [TVItemInfrastructureTypeTVItemLink]

            //CSSPError: Type not implemented [FlowTo] of type [TVItemInfrastructureTypeTVItemLink]
            retStr = "";      // added to stop compiling CSSPError
            if (retStr != "") // will never be true
            {
                tvItemInfrastructureTypeTVItemLink.HasErrors = true;
                yield return(new ValidationResult("AAA", new[] { "AAA" }));
            }
        }
 public TVItemInfrastructureTypeTVItemLinkTest()
 {
     tVItemInfrastructureTypeTVItemLink = new TVItemInfrastructureTypeTVItemLink();
 }