Esempio n. 1
0
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>();

            values.Add(BuiltInPublishingPageLayoutNames.ArticleLeft);
            values.Add(BuiltInPublishingPageLayoutNames.ArticleLinks);
            values.Add(BuiltInPublishingPageLayoutNames.ArticleRight);
            values.Add(BuiltInPublishingPageLayoutNames.BlankWebPartPage);
            values.Add(BuiltInPublishingPageLayoutNames.CatalogArticle);
            values.Add(BuiltInPublishingPageLayoutNames.CatalogWelcome);
            values.Add(BuiltInPublishingPageLayoutNames.EnterpriseWiki);

            if (prop.PropertyType == typeof(string))
            {
                newValue = RndService.RandomFromArray(values);
            }

            if (prop.PropertyType == typeof(Collection <string>))
            {
                newValue = RndService.RandomCollectionFromArray(values);
            }

            return(newValue);
        }
Esempio n. 2
0
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var newLocaleIdValue = 1033 + RndService.Int(5);

            if (prop.PropertyType == typeof(int))
            {
                newValue = newLocaleIdValue;
            }
            else if (prop.PropertyType == typeof(int?))
            {
                newValue = RndService.Bool() ? (int?)null : newLocaleIdValue;
            }
            else if (prop.PropertyType == typeof(uint))
            {
                newValue = (uint)newLocaleIdValue;
            }
            else if (prop.PropertyType == typeof(uint?))
            {
                newValue = (uint?)(RndService.Bool() ? (uint?)null : (uint?)newLocaleIdValue);
            }

            return(newValue);
        }
Esempio n. 3
0
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var typedAttr = attr as ExpectUpdateAsIntRange;

            var minValue = typedAttr.MinValue;
            var maxValue = typedAttr.MaxValue;

            var tmpValue = minValue + RndService.Int(maxValue - minValue);

            if (prop.PropertyType == typeof(double?) ||
                prop.PropertyType == typeof(double))
            {
                newValue = Convert.ToDouble(tmpValue);
            }
            else if (prop.PropertyType == typeof(UInt16?) ||
                     prop.PropertyType == typeof(UInt16))
            {
                newValue = Convert.ToUInt16(tmpValue);
            }
            else
            {
                // TODO, as per case
                newValue = tmpValue;
            }

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>();

            values.Add(BuiltInTargetControlType.ContentWebParts);
            values.Add(BuiltInTargetControlType.Custom);
            values.Add(BuiltInTargetControlType.Refinement);
            values.Add(BuiltInTargetControlType.SearchBox);
            values.Add(BuiltInTargetControlType.SearchHoverPanel);
            values.Add(BuiltInTargetControlType.SearchResults);

            if (prop.PropertyType == typeof(string))
            {
                newValue = RndService.RandomFromArray(values);
            }

            if (prop.PropertyType == typeof(List <string>))
            {
                newValue = RndService.RandomArrayFromArray(values).ToList();
            }

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>();

            values.Add("4");
            values.Add("15");

            if (prop.PropertyType == typeof(string))
            {
                newValue = RndService.RandomFromArray(values);
            }

            if (prop.PropertyType == typeof(Collection <string>))
            {
                newValue = RndService.RandomCollectionFromArray(values);;
            }

            if (prop.PropertyType == typeof(List <string>))
            {
                newValue = RndService.RandomListFromArray(values);
            }

            return(newValue);
        }
Esempio n. 6
0
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>();

            values.Add(BuiltInBasePermissions.AddAndCustomizePages);
            values.Add(BuiltInBasePermissions.AnonymousSearchAccessWebLists);
            values.Add(BuiltInBasePermissions.ApproveItems);
            values.Add(BuiltInBasePermissions.CancelCheckout);
            values.Add(BuiltInBasePermissions.CreateSSCSite);
            values.Add(BuiltInBasePermissions.EditMyUserInfo);

            if (prop.PropertyType == typeof(string))
            {
                newValue = RndService.RandomFromArray(values);
            }

            if (prop.PropertyType == typeof(Collection <string>))
            {
                newValue = RndService.RandomCollectionFromArray(values);
            }

            return(newValue);
        }
Esempio n. 7
0
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            newValue = string.Format("=ID*{0}", RndService.Int(100));

            return(newValue);
        }
Esempio n. 8
0
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            newValue = string.Format("<View BaseViewID='{0}'/>", RndService.Int(100) + 1);

            return(newValue);
        }
Esempio n. 9
0
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            newValue =
                string.Format(
                    "<Where><Eq><FieldRef Name=\"Title\" /><Value Type=\"Text\">{0}</Value></Eq></Where>",
                    RndService.String());

            return(newValue);
        }
Esempio n. 10
0
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>();

            values.Add(BuiltInInternalFieldNames.ID);
            values.Add(BuiltInInternalFieldNames.Title);

            newValue = RndService.RandomFromArray(values);

            return(newValue);
        }
Esempio n. 11
0
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>();

            values.Add(BuiltInDeveloperDashboardLevel.Off);
            values.Add(BuiltInDeveloperDashboardLevel.On);
            values.Add(BuiltInDeveloperDashboardLevel.OnDemand);

            newValue = RndService.RandomFromArray(values);

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>();

            values.Add(BuiltInPartChromeState.Minimized);
            values.Add(BuiltInPartChromeState.Normal);

            if (prop.PropertyType == typeof(string))
            {
                newValue = RndService.RandomFromArray(values);
            }

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var typedAttr     = attr as ExpectUpdateAsFileName;
            var fileExtension = typedAttr.Extension;

            if (!fileExtension.StartsWith("."))
            {
                fileExtension = "." + fileExtension;
            }

            newValue = string.Format("{0}{1}", RndService.String(), fileExtension);

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var list = new List <string>(new[]
            {
                BuiltInViewScope.Default,
                BuiltInViewScope.FilesOnly,
                BuiltInViewScope.Recursive,
                BuiltInViewScope.RecursiveAll
            });

            newValue = RndService.RandomFromArray(list);

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>
            {
                "Override",
                "Standalone"
            };

            if (prop.PropertyType == typeof(string))
            {
                newValue = RndService.RandomFromArray(values);
            }

            return(newValue);
        }
Esempio n. 16
0
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            if (prop.PropertyType == typeof(int?) ||
                prop.PropertyType == typeof(int?))
            {
                newValue = Convert.ToInt32(RndService.Byte().ToString());
            }
            else
            {
                // TODO, as per case
                newValue = RndService.Byte();
            }

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var value  = prop.GetValue(obj) as string;
            var values = new List <string>(new[]
            {
                //BuiltInToolbarType.Freeform,
                BuiltInToolbarType.None,
                BuiltInToolbarType.Standard,
            });

            values.Remove(value);

            newValue = RndService.RandomFromArray(values);

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            var curentValue = prop.GetValue(obj) as string;

            var values = new List <string>();

            values.Add(BuiltInRichTextMode.Compatible);
            values.Add(BuiltInRichTextMode.FullHtml);
            values.Add(BuiltInRichTextMode.HtmlAsXml);
            //values.Add(BuiltInRichTextMode.ThemeHtml);

            if (!string.IsNullOrEmpty(curentValue))
            {
                values.Remove(curentValue);
            }

            return(RndService.RandomFromArray(values));
        }
Esempio n. 19
0
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>();

            values.Add(BuiltInCalendarType.Gregorian);
            values.Add(BuiltInCalendarType.Korea);
            values.Add(BuiltInCalendarType.Hebrew);
            values.Add(BuiltInCalendarType.GregorianArabic);
            values.Add(BuiltInCalendarType.SakaEra);

            if (prop.PropertyType == typeof(string))
            {
                newValue = RndService.RandomFromArray(values);
            }

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>();

            values.Add(BuiltInNumberFormatTypes.Automatic);

            values.Add(BuiltInNumberFormatTypes.FiveDecimals);
            values.Add(BuiltInNumberFormatTypes.FourDecimals);
            values.Add(BuiltInNumberFormatTypes.ThreeDecimals);
            values.Add(BuiltInNumberFormatTypes.TwoDecimals);
            values.Add(BuiltInNumberFormatTypes.OneDecimal);
            values.Add(BuiltInNumberFormatTypes.NoDecimal);

            newValue = RndService.RandomFromArray(values);

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>();

            values.Add(BuiltInPartChromeType.BorderOnly);
            values.Add(BuiltInPartChromeType.Default);
            values.Add(BuiltInPartChromeType.None);
            values.Add(BuiltInPartChromeType.TitleAndBorder);
            values.Add(BuiltInPartChromeType.TitleOnly);

            if (prop.PropertyType == typeof(string))
            {
                newValue = RndService.RandomFromArray(values);
            }

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <int>();

            values.Add(BuiltInWebpartPageTemplateId.spstd1);
            values.Add(BuiltInWebpartPageTemplateId.spstd2);
            values.Add(BuiltInWebpartPageTemplateId.spstd3);
            values.Add(BuiltInWebpartPageTemplateId.spstd4);
            values.Add(BuiltInWebpartPageTemplateId.spstd5);
            values.Add(BuiltInWebpartPageTemplateId.spstd6);
            values.Add(BuiltInWebpartPageTemplateId.spstd7);

            if (prop.PropertyType == typeof(int))
            {
                newValue = RndService.RandomFromArray(values);
            }

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>();

            values.Add(BuiltInInternalFieldNames.ID);
            values.Add(BuiltInInternalFieldNames.Edit);
            values.Add(BuiltInInternalFieldNames.Created);
            values.Add(BuiltInInternalFieldNames._Author);

            if (prop.PropertyType == typeof(string))
            {
                newValue = values[RndService.Int(values.Count - 1)];
            }

            if (prop.PropertyType == typeof(Collection <string>))
            {
                newValue = RndService.RandomCollectionFromArray(values);
            }

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>();

            values.Add(BuiltInPublishingContentTypeId.ArticlePage);
            values.Add(BuiltInPublishingContentTypeId.EnterpriseWikiPage);
            values.Add(BuiltInPublishingContentTypeId.ErrorPage);
            values.Add(BuiltInPublishingContentTypeId.RedirectPage);

            if (prop.PropertyType == typeof(string))
            {
                newValue = RndService.RandomFromArray(values);
            }

            if (prop.PropertyType == typeof(Collection <string>))
            {
                newValue = RndService.RandomCollectionFromArray(values);
            }

            return(newValue);
        }
Esempio n. 25
0
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>();

            values.Add(BuiltInCompatibleSearchDataTypes.Integer);
            values.Add(BuiltInCompatibleSearchDataTypes.DateTime);
            values.Add(BuiltInCompatibleSearchDataTypes.Decimal);
            values.Add(BuiltInCompatibleSearchDataTypes.Text);
            values.Add(BuiltInCompatibleSearchDataTypes.YesNo);

            if (prop.PropertyType == typeof(string))
            {
                newValue = RndService.RandomFromArray(values);
            }

            if (prop.PropertyType == typeof(List <string>))
            {
                newValue = RndService.RandomArrayFromArray(values).ToList();
            }

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var values = new List <string>();

            values.Add(BuiltInInternalFieldNames.ID);
            values.Add(BuiltInInternalFieldNames.FileRef);
            values.Add(BuiltInInternalFieldNames.FileType);
            values.Add(BuiltInInternalFieldNames.File_x0020_Size);
            values.Add(BuiltInInternalFieldNames.FirstName);

            if (prop.PropertyType == typeof(string))
            {
                newValue = RndService.RandomFromArray(values);
            }

            if (prop.PropertyType == typeof(Collection <string>))
            {
                newValue = RndService.RandomCollectionFromArray(values);
            }

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = null;

            var curentValue = prop.GetValue(obj) as string;

            if (curentValue == BuiltInDateTimeFieldFormatType.DateOnly)
            {
                newValue = BuiltInDateTimeFieldFormatType.DateTime;
            }
            if (curentValue == BuiltInDateTimeFieldFormatType.DateTime)
            {
                newValue = BuiltInDateTimeFieldFormatType.DateOnly;
            }
            else
            {
                newValue = RndService.RandomFromArray(new string[] {
                    BuiltInDateTimeFieldFormatType.DateOnly,
                    BuiltInDateTimeFieldFormatType.DateTime
                });
            }

            return(newValue);
        }
Esempio n. 28
0
 public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
 {
     return(RndService.UserLogin());
 }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = RndService.Bool() ? "1" : "0";

            return(newValue);
        }
        public override object GetNewPropValue(ExpectUpdate attr, object obj, PropertyInfo prop)
        {
            object newValue = string.Format("{0}@m2-regression-test.com", RndService.String());

            return(newValue);
        }