/// <summary>
        /// Gets the recent actions.
        /// </summary>
        /// <typeparam name="TEntity">The type of the <see cref="Table{TEntity}" />.</typeparam>
        /// <param name="sqlEntities">The SQL entities.</param>
        /// <param name="operation">The operation.</param>
        /// <returns>Last entry of from the <see cref="Table{TEntity}" /> for the selected <paramref name="operation" />.</returns>
        public static TEntity GetRecentActions <TEntity>(DataContext sqlEntities, OperationName operation)
            where TEntity : class, IArchivingOperationLogs, new()
        {
            TEntity _recentActions = sqlEntities.GetTable <TEntity>().Where <TEntity>(x => x.Operation.Contains(operation.ToString())).OrderByDescending <TEntity, DateTime>(x => x.Date).FirstOrDefault();

            return(_recentActions);
        }
Esempio n. 2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="Rest.ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (EventName != null)
     {
         EventName.Validate();
     }
     if (Category != null)
     {
         Category.Validate();
     }
     if (ResourceProviderName != null)
     {
         ResourceProviderName.Validate();
     }
     if (ResourceType != null)
     {
         ResourceType.Validate();
     }
     if (OperationName != null)
     {
         OperationName.Validate();
     }
     if (Status != null)
     {
         Status.Validate();
     }
     if (SubStatus != null)
     {
         SubStatus.Validate();
     }
 }
Esempio n. 3
0
 private Operation(OperationName name, DateTime operationDate, Amount amount, Amount balance)
 {
     _name    = name;
     _date    = operationDate;
     _amount  = amount;
     _balance = balance;
 }
        public bool CanExecute(OperationContext context)
        {
            //check operation Name
            if (OperationName.Equals(context.OperationName) == false)
            {
                return(false);
            }

            //accept specific resource
            if (ExecuteOnSpecificInstance && string.IsNullOrWhiteSpace(context.ResourceId) == false)
            {
                return(true);
            }

            //accept specific type
            if (SupportedTypes.Any(t => t.ToString().Equals(context.ResourceType)) && string.IsNullOrEmpty(context.ResourceType) == false)
            {
                return(true);
            }

            //accept global
            if (SupportedTypes.Any(t => t.Equals(context.ResourceType)) == false && context.ResourceType == null)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 5
0
        private string AppendSuffix(string parentId, string suffix, char delimiter)
        {
#if DEBUG
            suffix = OperationName.Replace('.', '-') + "-" + suffix;
#endif
            if (parentId.Length + suffix.Length < RequestIdMaxLength)
            {
                return(parentId + suffix + delimiter);
            }

            //Id overflow:
            //find position in RequestId to trim
            int trimPosition = RequestIdMaxLength - 9; // overflow suffix + delimiter length is 9
            while (trimPosition > 1)
            {
                if (parentId[trimPosition - 1] == '.' || parentId[trimPosition - 1] == '_')
                {
                    break;
                }
                trimPosition--;
            }

            //ParentId is not valid Request-Id, let's generate proper one.
            if (trimPosition == 0)
            {
                return(GenerateRootId());
            }

            //generate overflow suffix
            string overflowSuffix = ((int)GetRandomNumber()).ToString("x8");
            return(parentId.Substring(0, trimPosition) + overflowSuffix + '#');
        }
        public ConventionBasedCodingStyle Merge(ConventionBasedCodingStyle other)
        {
            AddTypes(other.types);

            Type.Merge(other.Type);
            TypeIsValue.Merge(other.TypeIsValue);
            TypeIsView.Merge(other.TypeIsView);
            IdExtractor.Merge(other.IdExtractor);
            ValueExtractor.Merge(other.ValueExtractor);
            Locator.Merge(other.Locator);
            Converters.Merge(other.Converters);
            StaticInstances.Merge(other.StaticInstances);
            Initializers.Merge(other.Initializers);
            Datas.Merge(other.Datas);
            Operations.Merge(other.Operations);

            DataFetchedEagerly.Merge(other.DataFetchedEagerly);

            ParameterIsOptional.Merge(other.ParameterIsOptional);
            ParameterDefaultValue.Merge(other.ParameterDefaultValue);

            Module.Merge(other.Module);
            TypeName.Merge(other.TypeName);
            DataName.Merge(other.DataName);
            OperationName.Merge(other.OperationName);
            ParameterName.Merge(other.ParameterName);

            TypeMarks.Merge(other.TypeMarks);
            InitializerMarks.Merge(other.InitializerMarks);
            DataMarks.Merge(other.DataMarks);
            OperationMarks.Merge(other.OperationMarks);
            ParameterMarks.Merge(other.ParameterMarks);

            return(this);
        }
        public PatchRequest2 ComposeReferencePatch(
            string referenceAttributeName,
            string referencedObjectUniqueIdentifier,
            OperationName operationName)
        {
            Assert.IsFalse(string.IsNullOrWhiteSpace(referenceAttributeName));
            Assert.IsFalse(string.IsNullOrWhiteSpace(referencedObjectUniqueIdentifier));

            IPath path;

            Assert.IsTrue(Path.TryParse(referenceAttributeName, out path));
            OperationValue operationValue =
                new OperationValue()
            {
                Value = referencedObjectUniqueIdentifier
            };
            PatchOperation operation =
                new PatchOperation()
            {
                Name = operationName,
                Path = path
            };

            operation.AddValue(operationValue);

            PatchRequest2 result = new PatchRequest2();

            result.AddOperation(operation);
            return(result);
        }
Esempio n. 8
0
 private void PersistActivityProgress(ActivityProgress activityProgress, OperationName operationName, OperationState?operationState = null, int?operationContactCount = null, string operationDuration = null)
 {
     activityProgress.Operations[operationName.ToString()].Duration       = operationDuration ?? activityProgress.Operations[operationName.ToString()].Duration;
     activityProgress.Operations[operationName.ToString()].ContactCount   = operationContactCount ?? activityProgress.Operations[operationName.ToString()].ContactCount;
     activityProgress.Operations[operationName.ToString()].OperationState = operationState ?? activityProgress.Operations[operationName.ToString()].OperationState;
     _jobRepository.PersistActivityProgress(activityProgress);
 }
Esempio n. 9
0
        public override int GetHashCode()
        {
            int hashcode = 157;

            unchecked {
                hashcode = (hashcode * 397) + TraceIdLow.GetHashCode();
                hashcode = (hashcode * 397) + TraceIdHigh.GetHashCode();
                hashcode = (hashcode * 397) + SpanId.GetHashCode();
                hashcode = (hashcode * 397) + ParentSpanId.GetHashCode();
                hashcode = (hashcode * 397) + OperationName.GetHashCode();
                if (__isset.references)
                {
                    hashcode = (hashcode * 397) + TCollections.GetHashCode(References);
                }
                hashcode = (hashcode * 397) + Flags.GetHashCode();
                hashcode = (hashcode * 397) + StartTime.GetHashCode();
                hashcode = (hashcode * 397) + Duration.GetHashCode();
                if (__isset.tags)
                {
                    hashcode = (hashcode * 397) + TCollections.GetHashCode(Tags);
                }
                if (__isset.logs)
                {
                    hashcode = (hashcode * 397) + TCollections.GetHashCode(Logs);
                }
            }
            return(hashcode);
        }
Esempio n. 10
0
 /// <summary>
 /// <inheritdoc cref="Object.GetHashCode"/>
 /// </summary>
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = Query.GetHashCode();
         hashCode = (hashCode * 397) ^ OperationName?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ Variables?.GetHashCode() ?? 0;
         return(hashCode);
     }
 }
Esempio n. 11
0
        public PatchOperation2SingleValued(OperationName operationName, string pathExpression, string value)
            : base(operationName, pathExpression)
        {
            if (string.IsNullOrWhiteSpace(value))
            {
                throw new ArgumentNullException(nameof(value));
            }

            this.valueValue = value;
        }
Esempio n. 12
0
        protected PatchOperation2Base(OperationName operationName, string pathExpression)
        {
            if (string.IsNullOrWhiteSpace(pathExpression))
            {
                throw new ArgumentNullException(nameof(pathExpression));
            }

            this.Name = operationName;
            this.Path = Microsoft.SCIM.Path.Create(pathExpression);
        }
Esempio n. 13
0
        protected PatchOperationBase(OperationName operationName, string pathExpression)
        {
            if (string.IsNullOrWhiteSpace(pathExpression))
            {
                throw new ArgumentNullException(nameof(pathExpression));
            }

            this.Name = operationName;
            this.Path = Microsoft.AzureAD.Provisioning.ScimReference.Api.Protocol.Path.Create(pathExpression);
        }
Esempio n. 14
0
        public override bool Equals(object obj)
        {
            var edge = obj as CallGraphEdge;

            return(edge != null &&
                   OperationName.Equals(edge.OperationName) &&
                   OperationCallerName.Equals(edge.OperationCallerName) &&
                   FunctorSpecialization == edge.FunctorSpecialization &&
                   CallerFunctorSpecialization == edge.CallerFunctorSpecialization);
        }
Esempio n. 15
0
        public IList <OperationName> GetOperationNames(OperationName operationName)
        {
            Hashtable hashTable = new Hashtable();

            hashTable.Add("operationName", operationName);
            string sql     = IBatisHelper.GetRuntimeSql(base.GetSqlMapper(databaseName), "Operation.OperationName.GetOperationNames", hashTable);
            var    reValue = base.GetSqlMapper(databaseName).QueryForList <OperationName>("Operation.OperationName.GetOperationNames", hashTable);

            return(reValue);
        }
    public override int GetHashCode()
    {
        unchecked
        {
            var hashCode = Query != null?Query.GetHashCode() : 0;

            hashCode = (hashCode * 397) ^ (Variables != null ? Variables.GetHashCode() : 0);
            hashCode = (hashCode * 397) ^ (OperationName != null ? OperationName.GetHashCode() : 0);
            return(hashCode);
        }
    }
 internal static void UpdateActivitiesLogs(IPRDEV sqlEntities, OperationName operation, ProgressChangedEventHandler progressChanged)
 {
     Linq2SQL.ArchivingOperationLogs _logs = new ArchivingOperationLogs()
     {
         Date      = DateTime.Now,
         Operation = operation.ToString(),
         UserName  = Extensions.UserName()
     };
     sqlEntities.ArchivingOperationLogs.InsertOnSubmit(_logs);
     sqlEntities.SubmitChanges();
     progressChanged(1, new ProgressChangedEventArgs(1, "Updated ActivitiesLogs"));
 }
Esempio n. 18
0
        private int InternalHashCode()
        {
            var       hashCode = 419446955;
            const int hashSeed = -1521134295;

            hashCode = hashCode * hashSeed + OperationName.GetHashCode();
            hashCode = hashCode * hashSeed + OperationCallerName.GetHashCode();
            hashCode = hashCode * hashSeed + EqualityComparer <OperationFunctor> .Default.GetHashCode(FunctorSpecialization);

            hashCode = hashCode * hashSeed + EqualityComparer <OperationFunctor> .Default.GetHashCode(CallerFunctorSpecialization);

            return(hashCode);
        }
        /// <summary>
        /// Updates the activities logs.
        /// </summary>
        /// <typeparam name="TEntity">The type of the entity.</typeparam>
        /// <param name="sqlEntities">The SQL entities.</param>
        /// <param name="operation">The operation.</param>
        /// <param name="progressChanged">The progress changed.</param>
        public static void UpdateActivitiesLogs <TEntity>(DataContext sqlEntities, OperationName operation, Action <ProgressChangedEventArgs> progressChanged)
            where TEntity : class, IArchivingOperationLogs, new()
        {
            TEntity _logs = new TEntity()
            {
                Date      = DateTime.Now,
                Operation = operation.ToString(),
                UserName  = UserName()
            };

            sqlEntities.GetTable <TEntity>().InsertOnSubmit(_logs);
            sqlEntities.SubmitChanges();
            progressChanged(new ProgressChangedEventArgs(1, String.Format("Updated ActivitiesLogs for operation {0}", operation)));
        }
Esempio n. 20
0
        public void Normalize()
        {
            OperationName = OperationName == null ? MethodName : OperationName.Trim('"');

            ContentTypes        = NormalizeList(ContentTypes);
            AllowedRoles        = NormalizeList(AllowedRoles);
            RequiredPermissions = NormalizeList(RequiredPermissions);
            RequiredPolicies    = NormalizeList(RequiredPolicies);
            Scenarios           = NormalizeList(Scenarios);

            Description = Description?.Trim('"').Trim();

            Documentation = ParseDocumentation(Documentation);
        }
Esempio n. 21
0
        public short GetModel(string szOperNO, ref OperationName model)
        {
            if (base.HerenHisAccess == null)
            {
                return(SystemData.ReturnValue.PARAM_ERROR);
            }
            StringBuilder sbField = new StringBuilder();

            sbField.AppendFormat("*");
            string szCondition = string.Format("1=1");

            szCondition = string.Format("{0} AND {1} = '{2}' "
                                        , szCondition
                                        , SystemData.OperationNameTable.OPER_NO
                                        , szOperNO);
            string szSQL = string.Format(SystemData.SQL.SELECT_WHERE
                                         , sbField.ToString(), TableName, szCondition);
            IDataReader dataReader = null;

            try
            {
                dataReader = base.HerenHisAccess.ExecuteReader(szSQL, CommandType.Text);
                if (dataReader == null || dataReader.IsClosed || !dataReader.Read())
                {
                    return(SystemData.ReturnValue.RES_NO_FOUND);
                }
                if (model == null)
                {
                    model = new OperationName();
                }

                for (int i = 0; i < dataReader.FieldCount; i++)
                {
                    if (dataReader.IsDBNull(i))
                    {
                        continue;
                    }
                    PropertyInfo property = Reflect.GetPropertyInfo(typeof(OperationName), dataReader.GetName(i));
                    bool         result   = Reflect.SetPropertyValue(model, property, dataReader.GetValue(i));
                }

                return(SystemData.ReturnValue.OK);
            }
            catch (Exception ex)
            {
                LogManager.Instance.WriteLog("", new string[] { "szSQL" }, new object[] { szSQL }, ex);
                return(SystemData.ReturnValue.EXCEPTION);
            }
            finally { base.HerenHisAccess.CloseConnnection(false); }
        }
Esempio n. 22
0
 public bool Insert(OperationName item)
 {
     try
     {
         var result = base.GetSqlMapper(databaseName).Insert("Operation.OperationName.Insert", item);
         //SysMenu.ID = int.Parse(result.ToString());
         return(true);
     }
     catch (Exception ex)
     {
         GlobalMethod.log.Error(ex);
         return(false);
     }
 }
Esempio n. 23
0
        private string GenerateRootId()
        {
            if (s_uniqPrefix == null)
            {
                // Here we make an ID to represent the Process/AppDomain.   Ideally we use process ID but
                // it is unclear if we have that ID handy.   Currently we use low bits of high freq tick
                // as a unique random number (which is not bad, but loses randomness for startup scenarios).
                Interlocked.CompareExchange(ref s_uniqPrefix, GenerateInstancePrefix(), null);
            }
#if DEBUG
            string ret = s_uniqPrefix + "-" + OperationName.Replace('.', '-') + "-" + Interlocked.Increment(ref s_currentRootId).ToString("x") + '.';
#else       // To keep things short, we drop the operation name
            string ret = s_uniqPrefix + "-" + Interlocked.Increment(ref s_currentRootId).ToString("x") + '.';
#endif
            return(ret);
        }
Esempio n. 24
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = PartitionKey?.GetHashCode() ?? 0;
                hashCode = (hashCode * 397) ^ (RowKey?.GetHashCode() ?? 0);
                hashCode = (hashCode * 397) ^ Created.GetHashCode();
                hashCode = (hashCode * 397) ^ (EventType?.GetHashCode() ?? 0);
                hashCode = (hashCode * 397) ^ (OperationName?.GetHashCode() ?? 0);
                hashCode = (hashCode * 397) ^ (OrganizationId?.GetHashCode() ?? 0);
                hashCode = (hashCode * 397) ^ (SubscriptionId?.GetHashCode() ?? 0);
                hashCode = (hashCode * 397) ^ (Data?.GetHashCode() ?? 0);

                return(hashCode);
            }
        }
        public override bool Equals(object o)
        {
            if (this == o) {
                return true;
            }

            if (o == null || GetType() != o.GetType()) {
                return false;
            }

            var that = (QueryGraphValueEntryCustomKeyForge) o;

            if (!OperationName.Equals(that.OperationName)) {
                return false;
            }

            return ExprNodeUtilityCompare.DeepEquals(ExprNodes, that.ExprNodes, true);
        }
Esempio n. 26
0
        /// <summary>
        /// 哈希数
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hasCode = 0;

            if (Name != null)
            {
                hasCode += Name.GetHashCode();
            }
            if (OperationName != null)
            {
                hasCode += OperationName.GetHashCode();
            }
            if (ParamFilePath != null)
            {
                hasCode += ParamFilePath.GetHashCode();
            }
            return(hasCode);
        }
Esempio n. 27
0
        public override string ToString()
        {
            var sb = new StringBuilder("Span(");

            sb.Append(", TraceIdLow: ");
            TraceIdLow.ToString(sb);
            sb.Append(", TraceIdHigh: ");
            TraceIdHigh.ToString(sb);
            sb.Append(", SpanId: ");
            SpanId.ToString(sb);
            sb.Append(", ParentSpanId: ");
            ParentSpanId.ToString(sb);
            if ((OperationName != null))
            {
                sb.Append(", OperationName: ");
                OperationName.ToString(sb);
            }
            if ((References != null) && __isset.references)
            {
                sb.Append(", References: ");
                References.ToString(sb);
            }
            sb.Append(", Flags: ");
            Flags.ToString(sb);
            sb.Append(", StartTime: ");
            StartTime.ToString(sb);
            sb.Append(", Duration: ");
            Duration.ToString(sb);
            if ((Tags != null) && __isset.tags)
            {
                sb.Append(", Tags: ");
                Tags.ToString(sb);
            }
            if ((Logs != null) && __isset.logs)
            {
                sb.Append(", Logs: ");
                Logs.ToString(sb);
            }
            sb.Append(')');
            return(sb.ToString());
        }
Esempio n. 28
0
        public static PatchOperation2 Create(OperationName operationName, string pathExpression, string value)
        {
            if (string.IsNullOrWhiteSpace(pathExpression))
            {
                throw new ArgumentNullException(nameof(pathExpression));
            }

            if (string.IsNullOrWhiteSpace(value))
            {
                throw new ArgumentNullException(nameof(value));
            }

            OperationValue operationValue = new OperationValue();

            operationValue.Value = value;

            PatchOperation2 result = new PatchOperation2(operationName, pathExpression);

            result.AddValue(operationValue);

            return(result);
        }
        public static PatchOperation Create(OperationName operationName, string pathExpression, string value)
        {
            if (string.IsNullOrWhiteSpace(pathExpression))
            {
                throw new ArgumentNullException(nameof(pathExpression));
            }

            if (string.IsNullOrWhiteSpace(value) && operationName != Protocol.OperationName.Remove)
            {
                throw new ArgumentNullException(nameof(value));
            }

            JObject operationValue = new JObject();

            operationValue.Add("value", value);

            PatchOperation result = new PatchOperation(operationName, pathExpression);

            result.AddValue(operationValue);

            return(result);
        }
Esempio n. 30
0
    public override int GetHashCode()
    {
        int hash = 1;

        if (Query.Length != 0)
        {
            hash ^= Query.GetHashCode();
        }
        if (IsSchemaQuery != false)
        {
            hash ^= IsSchemaQuery.GetHashCode();
        }
        if (OperationName.Length != 0)
        {
            hash ^= OperationName.GetHashCode();
        }
        if (Variables.Length != 0)
        {
            hash ^= Variables.GetHashCode();
        }
        return(hash);
    }
        /// <summary>
        /// Verify the response results.
        /// </summary>
        /// <param name="results">The results information from server.</param>
        /// <param name="operationName">The operation name for the server response results.</param>
        /// <param name="versioningEnabled">A Boolean indicates whether the versioning is enabled.</param>
        public void VerifyResultsInformation(Results results, OperationName operationName, bool versioningEnabled)
        {
            this.site.Assert.AreNotEqual<string>(
                string.Empty,
                this.listId,
                "GetListID operation returns {0}, the non-empty value means the operation was executed successfully" +
                " and the empty value means the operation failed",
                this.listId);

            // Verify MS-VERSS requirement: MS-VERSS_R39
            this.site.CaptureRequirementIfAreEqual<string>(
                this.listId.ToUpper(System.Globalization.CultureInfo.CurrentCulture),
                results.list.id.ToUpper(System.Globalization.CultureInfo.CurrentCulture),
                39,
                @"[In Results] list.id: Specifies the GUID of the document library in which the file resides.");

            if (versioningEnabled == true)
            {
                // Verify MS-VERSS requirement: MS-VERSS_R44
                this.site.CaptureRequirementIfAreEqual<byte>(
                    1,
                    results.versioning.enabled,
                    44,
                    @"[In Results] versioning.enabled: A value of ""1"" indicates that versioning is enabled.");
            }
            else
            {
                // Verify MS-VERSS requirement: MS-VERSS_R43
                this.site.CaptureRequirementIfAreEqual<byte>(
                    0,
                    results.versioning.enabled,
                    43,
                    @"[In Results] versioning.enabled: A value of ""0"" indicates that versioning is disabled.");
            }

            // Verify version data.
            this.VerifyVersionData(results.result, operationName);
        }
 public CompressArgs(OperationName operation, FileInfo input, FileInfo output)
 {
     Operation = operation;
     Input = input;
     Output = output;
 }
        /// <summary>
        /// Verify the version data information from server response results.
        /// </summary>
        /// <param name="versionData">The version data from server response results.</param>
        /// <param name="operationName">The operation name for the server response results.</param>
        private void VerifyVersionData(VersionData[] versionData, OperationName operationName)
        {
            bool areVersionsResultEqual = false;

            string fileVersionsFromSUT = string.Empty;

            // The file versions get from GetVersions response
            VersionData[] fileVersionsFromGetVersions = null;

            // If the VersionData are got from GetVersions operation, use SUT method GetFileVersions to
            // verify the VersionData. Else use protocol method GetVersions to verify the VersionData.
            if (operationName == OperationName.GetVersions)
            {
                fileVersionsFromSUT = this.sutControlAdapterInstance.GetFileVersions(this.documentLibrary, this.fileName);
                this.site.Assert.AreNotEqual<string>(
                    string.Empty,
                    fileVersionsFromSUT,
                    "GetFileVersions operation returns {0}, the not empty value means the operation executed" +
                    " successfully and the empty value means the operation failed",
                    fileVersionsFromSUT);

                // Verify that the result element returned from server using
                // Protocol Adapter equals the result element returned from server using SUT Control Adapter.
                areVersionsResultEqual = AdapterHelper.AreVersionsResultEqual(fileVersionsFromSUT, versionData);
            }
            else
            {
                // Get the relative filename of the file.
                string docRelativeUrl = this.documentLibrary + "/" + this.fileName;

                // Get the versions information from server.
                GetVersionsResponseGetVersionsResult getVersionsResponse = 
                    this.protocolAdapterInstance.GetVersions(docRelativeUrl);
                fileVersionsFromGetVersions = getVersionsResponse.results.result;

                // Verify that the result element returned from server equals 
                // the result element returned from GetVersions response.
                areVersionsResultEqual = AdapterHelper.AreVersionsResultEqual(fileVersionsFromGetVersions, versionData);
            }

            // Verify MS-VERSS requirement: MS-VERSS_R48 
            this.site.CaptureRequirementIfIsTrue(
                areVersionsResultEqual,
                48,
                @"[In Results] result: A separate result element MUST exist for each version of the file that the user can access.");

            string responseVersionData = TransformVersionDataToString(versionData);

            switch (operationName)
            {
                case OperationName.GetVersions:

                    // Add the debug information
                    this.site.Log.Add(
                        LogEntryKind.Debug,
                        "The actual response of GetVersions is {0} and the expected response of GetVersions is {1}",
                        responseVersionData,
                        fileVersionsFromSUT);

                    // Verify MS-VERSS requirement: MS-VERSS_R131
                    this.site.CaptureRequirementIfIsTrue(
                        areVersionsResultEqual,
                        131,
                        @"[In GetVersionsResponse] GetVersionsResult: An XML node that conforms to the structure specified in section 2.2.4.1 and that contains the details about all the versions of the specified file that the user can access.");
                    break;

                case OperationName.DeleteVersion:
                    // Add the debug information 
                    this.site.Log.Add(
                        LogEntryKind.Debug,
                        "The actual response of DeleteVersion is {0} and the expected response of DeleteVersion is {1}",
                        responseVersionData,
                        TransformVersionDataToString(fileVersionsFromGetVersions));

                    // Verify MS-VERSS requirement: MS-VERSS_R112
                    this.site.CaptureRequirementIfIsTrue(
                        areVersionsResultEqual,
                        112,
                        @"[In DeleteVersionResponse] DeleteVersionResult: An XML node that conforms to the structure specified in section 2.2.4.1 and that contains the details about all the versions of the specified file that the user can access.");
                    break;

                case OperationName.RestoreVersion:
                    // Add the debug information
                    this.site.Log.Add(
                        LogEntryKind.Debug,
                        "The actual response of RestoreVersion is {0} and the expected response of RestoreVersion is {1}",
                        responseVersionData,
                        TransformVersionDataToString(fileVersionsFromGetVersions));

                    // Verify MS-VERSS requirement: MS-VERSS_R152
                    this.site.CaptureRequirementIfIsTrue(
                        areVersionsResultEqual,
                        152,
                        @"[In RestoreVersionResponse] RestoreVersionResult: MUST return an XML node that conforms to the structure specified in section 2.2.4.1, which contains the details about all the versions of the specified file that the user can access.");
                    break;

                case OperationName.DeleteAllVersions:
                    // Add the debug information
                    this.site.Log.Add(
                        LogEntryKind.Debug,
                        "The actual response of DeleteAllVersions is {0} and the expected response of DeleteAllVersions is {1}",
                        responseVersionData,
                        TransformVersionDataToString(fileVersionsFromGetVersions));

                    // Verify MS-VERSS requirement: MS-VERSS_R92
                    this.site.CaptureRequirementIfIsTrue(
                        areVersionsResultEqual,
                        92,
                        @"[In DeleteAllVersionsResponse] DeleteAllVersionsResult: An XML node that conforms to the structure specified in section 2.2.4.1 and that contains the  details about all the versions of the specified file that the user can access.");
                    break;
            }

            foreach (VersionData data in versionData)
            {
                string specifiedVersionFileInformation = string.Empty;
                if (this.fileVersionAttributes.ContainsKey(data.version.Replace("@", string.Empty)) == false)
                {
                    // Get data version information from server.
                    specifiedVersionFileInformation = this.sutControlAdapterInstance.GetFileVersionAttributes(
                        this.documentLibrary,
                        this.fileName,
                        data.version.Replace("@", string.Empty));

                    this.fileVersionAttributes.Add(data.version.Replace("@", string.Empty), specifiedVersionFileInformation);
                }
                else
                {
                    specifiedVersionFileInformation = this.fileVersionAttributes[data.version.Replace("@", string.Empty)];
                }

                this.site.Assert.AreNotEqual<string>(
                    string.Empty,
                    specifiedVersionFileInformation,
                    "GetSpecifiedVersionFileInformation operation returns {0}, the non-empty value means the" +
                    " operation was executed successfully and the empty value means the operation failed", 
                    specifiedVersionFileInformation);

                string[] attributes = specifiedVersionFileInformation.Split(new string[] { "^" }, StringSplitOptions.None);

                string expectedCreatedByName = attributes[0];
                expectedCreatedByName = expectedCreatedByName.Substring(expectedCreatedByName.IndexOf("\\", System.StringComparison.CurrentCulture) + 1);
                ulong expectedSize = ulong.Parse(attributes[1]);

                // According to Open Specification section 2.2.4.3, the createdByName attribute is an optional attribute.
                if (!string.IsNullOrEmpty(data.createdByName))
                {
                    // Verify MS-VERSS requirement: MS-VERSS_R165
                    this.site.CaptureRequirementIfAreEqual<string>(
                        expectedCreatedByName.ToLower(System.Globalization.CultureInfo.CurrentCulture),
                        data.createdByName.Substring(data.createdByName.IndexOf("\\", System.StringComparison.CurrentCulture) + 1).ToLower(System.Globalization.CultureInfo.CurrentCulture),
                        165,
                        @"[In VersionData] createdByName: The display name of the creator of the version of the file.");
                }

                // Verify MS-VERSS requirement: MS-VERSS_R64
                this.site.CaptureRequirementIfAreEqual<ulong>(
                    expectedSize,
                    data.size,
                    64,
                    @"[In VersionData] size: The size, in bytes, of the version of the file.");
            }
        }