public void TestOriginalSearchMenuConditionsValid(ResourceId resource)
        {
            var handler  = new OriginalSearchManager();
            var response = handler.OriginalSearch <List <ConditionsDataResponse> >(OriginalSearchHelpers.GetOriginalSearchConditionsParameters(resource), HttpMethod.Get);

            PrAssert.That(response, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK));
            PrAssert.That(response.Result.Select(item => item.Id), PrIs.Not.Null.And.Not.Empty);
            PrAssert.That(response.Result.Select(item => item.Label), PrIs.Not.Null.And.Not.Empty);
        }
        public void TestOriginalSearchDialogConditionValid(ResourceId resource)
        {
            var handler = new OriginalSearchManager();
            //Create conditions
            var conditions = handler.OriginalSearch <List <ConditionsDataResponse> >(OriginalSearchHelpers.GetOriginalSearchConditionsParameters(resource), HttpMethod.Get);

            PrAssume.That(conditions, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK));

            //Create a condition
            handler = new OriginalSearchManager("/privateapi/hrbc/condition");
            var condition = handler.OriginalSearch <ConditionDataResponse>(OriginalSearchHelpers.GetOriginalSearchConditionParameters(resource, conditions.Result.First().Id), HttpMethod.Get);

            PrAssert.That(condition, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK));
            PrAssert.That(condition.Result.Data, PrIs.Not.Null.And.Not.Empty);
        }
        public void TestOriginalSearchMenuConditionsLimitValidSpecial(ResourceId resource, int limit)
        {
            var handler = new OriginalSearchManager();
            var request = OriginalSearchHelpers.GetOriginalSearchConditionsParameters(resource);

            request["limit"] = limit.ToString();
            var response = handler.OriginalSearch <List <ConditionsDataResponse> >(request, HttpMethod.Get);

            if (limit == 0)
            {
                PrAssert.That(response, PrIs.ErrorResponse());
            }
            else
            {
                PrAssert.That(response, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK));
                PrAssert.That(response.Result.Count, PrIs.EqualTo(limit));
            }
        }
Beispiel #4
0
        private void AssertResponsedContent(ResourceId resource, Users user, string company, string login, string password)
        {
            var handler  = new OriginalSearchManager();
            var response = handler.LoginAndSendRequestWithOtherAccount <List <ConditionsDataResponse> >(company, login, password, Endpoint, OriginalSearchHelpers.GetOriginalSearchConditionsParameters(resource), HttpMethod.Get);

            PrAssume.That(response, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK));
            PrAssume.That(response.Result.Count, PrIs.EqualTo(Items[resource](user)));
            PrAssert.That(response.Result.Select(item => item.Label), PrIs.Not.Null.And.EqualTo(user == Users.DefaultUser ? OldContents : NewResponsedData[resource]));
        }