Beispiel #1
0
        public void InvalidReadField(ResourceId resourceId, CommonMapperValue.ValidReadId validId, CommonMapperValue.InvalidRead invalidRead)
        {
            string deleteUUID         = PreparedDeletedFieldId.Data[$"{resourceId}{IndexDeleted}"].ToString();
            string fieldFirstUUID     = PreparedFieldId.Data[$"{resourceId}0"].ToString();
            string fieldSecondUUID    = PreparedFieldId.Data[$"{resourceId}1"].ToString();
            string appFieldFirstUUID  = ApplicationFieldId.Data[resourceId].ToString();
            string appFieldSecondUUID = SecondApplicationFieldId.Data[resourceId].ToString();
            string sysFieldUUID       = SystemFields.GetSytemFieldUuidByFieldType(resourceId, NumberFieldTestData.TestingFieldType);
            var    request            = CommonMapperValue.ValidReadUUIDMapperValue[validId](fieldFirstUUID, fieldSecondUUID, appFieldFirstUUID, appFieldSecondUUID, sysFieldUUID);

            CommonMapperValue.InvalidReadMapperValue[invalidRead](deleteUUID, request);
            var handler  = new DefaultManager();
            var response = handler.Send <FieldDetailsResponse>(FieldManager.FieldHandlingRelativeUrl, request, HttpMethod.GET);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(HttpStatusCode.BadRequest), "Could not read field details");
        }
Beispiel #2
0
        public void ValidReadUserField(ResourceId resourceId, CommonMapperValue.ValidReadId validId, Selects.ValidSelect validSelect)
        {
            string fieldFirstUUID     = PreparedFieldId.Data[$"{resourceId}0"].ToString();
            string fieldSecondUUID    = PreparedFieldId.Data[$"{resourceId}1"].ToString();
            string appFieldFirstUUID  = ApplicationFieldId.Data[resourceId].ToString();
            string appFieldSecondUUID = SecondApplicationFieldId.Data[resourceId].ToString();
            string sysFieldUUID       = SystemFields.GetSytemFieldUuidByFieldType(resourceId, NumberFieldTestData.TestingFieldType);
            var    request            = CommonMapperValue.ValidReadUUIDMapperValue[validId](fieldFirstUUID, fieldSecondUUID, appFieldFirstUUID, appFieldSecondUUID, sysFieldUUID);

            request.AddRange(Selects.SelectMapperValue[validSelect]);
            var handler  = new DefaultManager();
            var response = handler.Send <FieldDetailsResponse>(FieldManager.FieldHandlingRelativeUrl, request, HttpMethod.GET);

            PrAssert.That(response, PrIs.SuccessfulResponse().And.HttpCode(HttpStatusCode.OK), "Could not read field details");
            Selects.VerifyContainExpectedSelect(response.Result, validSelect);
        }
Beispiel #3
0
        public void TestReadFieldInvalid(ResourceId resource, ValidReadId validReadId, InvalidRead invalidRead)
        {
            var firstUuidUser  = FieldsCreator.Data[$"{resource}-{Defines.FieldTypeApi.ToString()}-0"].Guid.ToString();
            var secondUuidUser = FieldsCreator.Data[$"{resource}-{Defines.FieldTypeApi.ToString()}-1"].Guid.ToString();
            var firstUuidApp   = TextHelpers.Guid[TextHelpers.FieldTypes.Application](resource, null, Defines.FieldTypeApi, TextHelpers.ApplicationFieldNames[Defines.FieldTypeApi]().First()).ToString();
            var secondUuidApp  = TextHelpers.Guid[TextHelpers.FieldTypes.Application](resource, null, Defines.FieldTypeApi, TextHelpers.ApplicationFieldNames[Defines.FieldTypeApi]().Last()).ToString();
            var deletedUuid    = FieldsCreator.Data[$"{resource}-{Defines.FieldTypeApi.ToString()}-2"].Guid.ToString();

            var request = ValidReadUUIDMapperValue[validReadId](firstUuidUser, secondUuidUser, firstUuidApp, secondUuidApp, SystemFields.GetSytemFieldUuidByFieldType(resource, FieldType.SingleLineText));

            InvalidReadMapperValue[invalidRead](deletedUuid, request);

            var handler  = new DefaultManager();
            var response = handler.Send <FieldDetailsResponseItem>(FieldManager.FieldHandlingRelativeUrl, request, HttpMethod.GET);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest));
        }
Beispiel #4
0
        public void TestReadFieldValid(ResourceId resource, ValidReadId validReadId, Selects.ValidSelect select)
        {
            var firstUuidUser  = FieldsCreator.Data[$"{resource}-{Defines.FieldTypeApi.ToString()}-0"].Guid.ToString();
            var secondUuidUser = FieldsCreator.Data[$"{resource}-{Defines.FieldTypeApi.ToString()}-1"].Guid.ToString();
            var firstUuidApp   = TextHelpers.Guid[TextHelpers.FieldTypes.Application](resource, null, Defines.FieldTypeApi, TextHelpers.ApplicationFieldNames[Defines.FieldTypeApi]().First()).ToString();
            var secondUuidApp  = TextHelpers.Guid[TextHelpers.FieldTypes.Application](resource, null, Defines.FieldTypeApi, TextHelpers.ApplicationFieldNames[Defines.FieldTypeApi]().Last()).ToString();

            var idParams = ValidReadUUIDMapperValue[validReadId](firstUuidUser, secondUuidUser, firstUuidApp, secondUuidApp, SystemFields.GetSytemFieldUuidByFieldType(resource, FieldType.SingleLineText));
            var sel      = Selects.SelectMapperValue[select];
            var request  = new List <KeyValuePair <string, string> >();

            request.AddRange(idParams);
            request.AddRange(sel);
            var handler  = new DefaultManager();
            var response = handler.Send <FieldDetailsResponse>(FieldManager.FieldHandlingRelativeUrl, request, HttpMethod.GET);

            PrAssert.That(response, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK));

            //Verify
            Selects.VerifyContainExpectedSelect(response.Result, select);
        }