Exemple #1
0
 public static IDictionary <string, object> Build(DateTime operationTime, OperationEnum operationType, string entity, IBaseModel document)
 {
     return(new Dictionary <string, object>()
     {
         { "timestamp", operationTime },
         { "operation", operationType.ToString().ToLower() },
         { entity, document },
     });
 }
 public MethodAttribute(Type entityType, OperationEnum operationEnum, string description = "")
 {
     if (entityType == null)
     {
         throw new ArgumentNullException("entityType");
     }
     this.operationName = operationEnum.ToString();
     this.description   = description;
     this.EntityType    = entityType;
 }
Exemple #3
0
        /// <summary>
        /// Test a operation (OperationEnum) on a file (pathEnum)
        /// </summary>
        /// <param name="operationEnum">type of operation (enum)</param>
        /// <param name="pathEnum">file path (enum)</param>
        /// <returns>report</returns>
        public StringBuilder Test(OperationEnum operationEnum, PathEnum pathEnum)
        {
            stringBuilder.Clear();

            string path = testsDictionary[pathEnum];

            readerWriter = new ReaderGraph(path);

            switch (operationEnum)
            {
            case OperationEnum.clearFile:
                ClearFile();
                break;

            case OperationEnum.createFile:
                CreateFile();
                break;

            case OperationEnum.deleteFile:
                DeleteFile();
                break;

            case OperationEnum.existFile:
                ExistFile();
                break;

            case OperationEnum.readFile:
                ReadFile();
                break;

            case OperationEnum.writeFile:
                WriteFile();
                break;

            default:
                throw new MyException.TestsException.TestsMissingTestException(operationEnum.ToString());
            }

            return(stringBuilder);
        }