Exemple #1
0
 public static PrivateData <Dictionary <object, Guid> > PrepareTwoUserField(int numberFieldType)
 {
     return(new PrivateData <Dictionary <object, Guid> >(
                (session, test) =>
     {
         return Task.Run(() =>
         {
             var handler = new FieldManager();
             var result = new Dictionary <object, Guid>();
             var properties = GenerateRequiredProperties(numberFieldType, Properties.Label.Max, FileType.Bmp);
             HeightMapperValue[Properties.Height.Max](properties);
             foreach (ResourceId resource in Utils.Resources())
             {
                 for (int i = 0; i < 2; i++)
                 {
                     var createResponse = handler.CreateField(resource, properties);
                     PrAssume.That(createResponse, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK), "Can not create field");
                     result.Add($"{resource}{i}", createResponse.Result.Id);
                 }
             }
             return result;
         });
     },
                (session, test, res) => Task.Run(() =>
     {
         foreach (var item in res)
         {
             var handler = new FieldManager();
             handler.DeleteField(item.Value);
         }
     })));
 }
Exemple #2
0
        public static Dictionary <string, object> GenerateProperties(int fieldType, Properties.Label label, Properties.Caption caption, Properties.Search search, Properties.Match match, Properties.Highlight highlight, Properties.Require require, Properties.Default defaultProperty, FileType mimeType, Properties.Height height)
        {
            var properties = GenerateRequiredProperties(fieldType, label, mimeType);

            CommonMapperValue.CaptionMapperValue[caption](properties);
            CommonMapperValue.SearchMapperValue[search](properties);
            CommonMapperValue.MatchMapperValue[match](properties);
            CommonMapperValue.HighlightMapperValue[highlight](properties);
            CommonMapperValue.RequireMapperValue[require](properties);
            DefaultMapperValue[defaultProperty](properties);
            HeightMapperValue[height](properties);
            return(properties);
        }