Esempio n. 1
0
        /// <summary>
        /// Read and verify datetime field value
        /// </summary>
        /// <param name="resourceName">Resource Name</param>
        /// <param name="id">Resource Id</param>
        /// <param name="fieldAlias">Field Alias</param>
        /// <returns>empty</returns>
        public static void ReadAndVerifyAutoDesignatedDate(Enums.ResourceType resourceType, string id, string fieldAlias)
        {
            string resourceName = resourceType.ToResourceName();
            ReadResponseData <XmlResource> result = FieldHelper.ReadResource(resourceType, id, new List <string> {
                fieldAlias
            });

            Assume.That(result, MustBe.ReadSuccess(1), string.Format(Enums.Message.READ_RESOURCE_FAILED, resourceName));
            DateTime tempDate;

            Assert.That(DateTime.TryParse(result.Items[0].DictionaryValues[fieldAlias].ToString(), out tempDate), ErrorMessage);
        }
Esempio n. 2
0
        /// <summary>
        /// Read and verify datetime field value
        /// </summary>
        /// <param name="resourceName">Resource Name</param>
        /// <param name="id">Resource Id</param>
        /// <param name="fieldAlias">Field Alias</param>
        /// <returns>empty</returns>
        public static void ReadAndVerifyNoValidationDate(Enums.ResourceType resourceType, string id, string fieldAlias)
        {
            string resourceName          = resourceType.ToResourceName();
            string registrationDateAlias = $"{resourceName}.{SystemTypeField.RegistrationDate}";
            string updateDateAlias       = $"{resourceName}.{SystemTypeField.UpdateDate}";

            ReadResponseData <XmlResource> result = FieldHelper.ReadResource(resourceType, id, new List <string> {
                registrationDateAlias, updateDateAlias
            });

            Assume.That(result, MustBe.ReadSuccess(1), string.Format(Enums.Message.READ_RESOURCE_FAILED, resourceName));
            VerifyLessOrGreaterThanDateTime(result, fieldAlias, registrationDateAlias, updateDateAlias);
        }