Exemplo n.º 1
0
        public void TestCreateGeneralFieldSettingValidation(Enums.ResourceType resourceType, string fieldName, FieldProperty fieldProperty, object val)
        {
            string fieldAlias = resourceType.ToResourceName() + "." + fieldName;

            //Expected 100 error code - field value is specified automatically
            WriteInvalidHelper.CreateSingleItem(resourceType, fieldAlias, Util.ToString(DateTime.Now), Enums.PublicAPIResultCode.ParameterIsInvalid, cleaner, records);
        }
        public void TestWriteResourceReadOnlyAccessSetting(Enums.ResourceType resourceType, bool isReadOnly)
        {
            string resourceName = resourceType.ToResourceName();
            string fieldAlias   = resourceName + "." + SystemTypeField.Owner;

            WriteInvalidHelper.CreateSingleItem(resourceType, fieldAlias, 1, Enums.PublicAPIResultCode.ParameterIsInvalid, cleaner, records);
        }
        public void TestCreateSingleItem(Enums.ResourceType resourceType, string fieldName, WriteInvalidInput valueType, int expectedCode)
        {
            string resourceName = resourceType.ToResourceName();
            string fieldAlias   = resourceName + "." + fieldName;

            WriteInvalidHelper.CreateSingleItem(resourceType, fieldAlias, (index) => GetInvalidFieldValue(resourceType, fieldName, valueType, index),
                                                expectedCode, cleaner, referenceRecords, true);
        }
Exemplo n.º 4
0
        public void TestCreateSingleItem(Enums.ResourceType resourceType, string fieldName)
        {
            string resourceName = resourceType.ToResourceName();
            string fieldAlias   = resourceName + "." + fieldName;

            WriteInvalidHelper.CreateSingleItem(resourceType, fieldAlias, (index) => GetInvalidFieldValue(resourceType, fieldName, index),
                                                Enums.PublicAPIResultCode.InvalidParameterValue, cleaner, referenceRecords, false);
        }
Exemplo n.º 5
0
        public void TestWriteResourceAccessSetting(Enums.ResourceType resourceType, string fieldName, bool isReadOnly)
        {
            string resourceName = resourceType.ToResourceName();
            string fieldAlias   = resourceName + "." + fieldName;

            //Expected 100 error code - field value is specified automatically
            WriteInvalidHelper.CreateSingleItem(resourceType, fieldAlias, Util.ToString(DateTime.Now, true), Enums.PublicAPIResultCode.InvalidParameterValue, cleaner, records);
        }
Exemplo n.º 6
0
        public void TestWriteResourceReadOnlyAccessSetting(Enums.ResourceType resourceType, string fieldName, bool isReadOnly)
        {
            string resourceName = resourceType.ToResourceName();
            string fieldAlias   = resourceName + "." + fieldName;

            WriteInvalidHelper.CreateSingleItem(resourceType, fieldAlias, (index) => GetValidFieldValue(resourceType, fieldName, index),
                                                Enums.PublicAPIResultCode.ParameterIsInvalid, cleaner, records, true);
        }
Exemplo n.º 7
0
        public void TestCreateSingleItem(Enums.ResourceType resourceType, string fieldName, string fieldValue, int expectedCode)
        {
            string fieldAlias = resourceType.ToResourceName() + "." + fieldName;

            if (fieldValue == null)
            {
                WriteValidHelper.CreateSingleItem(resourceType, fieldAlias, fieldValue, cleaner, records, null);
            }
            else
            {
                WriteInvalidHelper.CreateSingleItem(resourceType, fieldAlias, fieldValue, expectedCode, cleaner, records);
            }
        }
        public void TestCreateSingleItem(Enums.ResourceType resourceType, string fieldValue, int expectedCode)
        {
            string fieldAlias = resourceType.ToResourceName() + "." + SystemTypeField.Owner;

            WriteInvalidHelper.CreateSingleItem(resourceType, fieldAlias, fieldValue, expectedCode, cleaner, records);
        }