Beispiel #1
0
        public void ExchangeMappingInvalidContentTest(string mode, ContentParam contentParam, InvalidContent invalidContent, int expectedCode)
        {
            ExchangeMappingProperties requestBody = ExchangeMappingProperties.GetMappingContent(mode, mode == "import" ? CreatedImportMapping.Data : CreatedExportMapping.Data, Label, Name, Group, Resource, new List <string> {
                "Client.P_Id"
            }, Labels, GroupsDic, Items, AdditionConverters);
            var mappingHandler = new MappingManager();
            var response       = mappingHandler.ExchangeMapping <object>(InvalidContentMapper[contentParam](requestBody, invalidContent), System.Net.Http.HttpMethod.Put);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest).And.ErrorCode(100).Or.ErrorCode(116).Or.ErrorCode(103));
        }
Beispiel #2
0
        public object GetField(ContentParam param)
        {
            switch (param)
            {
            case (ContentParam.ID):
                return(ID);

            case (ContentParam.name):
                return(Name);
            }
            return(null);
        }
Beispiel #3
0
        public void UpdateField(ContentParam contentParam, object obj)
        {
            switch (contentParam)
            {
            case (ContentParam.header):
                Header = (string)obj;
                break;

            case (ContentParam.questionText):
                QuestionText = (string)obj;
                break;

            case (ContentParam.answerList):
                AnswerList = (List <Answer>)obj;
                break;

            case (ContentParam.questionPageTemplate):
                QuestionPageTemplate = (int)obj;
                break;
            }
        }
Beispiel #4
0
        public void UpdateField(ContentParam contentParam, object obj)
        {
            switch (contentParam)
            {
            case (ContentParam.name):
                Name = (string)obj;
                break;

            case (ContentParam.accessList):
                AccessList = (List <Access>)obj;
                break;

            case (ContentParam.tagList):
                TagList = (List <Tag>)obj;
                break;

            case (ContentParam.time):
                Time = new TimeSpan(0, Convert.ToInt32(obj), 0);
                break;

            case (ContentParam.canContinueAfterAbort):
                CanContinueAfterAbort = (bool)obj;
                break;

            case (ContentParam.evaluation):
                Evaluation = (Evaluation)obj;
                break;

            case (ContentParam.showAnswerMode):
                ShowAnswerMode = (int)obj;
                break;

            case (ContentParam.questionPageList):
                QuestionPageList = (List <Question>)obj;
                break;
            }
        }