public void TestTopOriginalSearchConditionsWithContractResource()
        {
            var handler  = new OriginalSearchManager(OriginalSearchHelpers.GetTopOriginalSearchConditionParameters(ResourceId.Contract, "1"));
            var response = handler.OriginalSearch <object>(System.Net.Http.HttpMethod.Get);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest));
        }
        public void TestTopOriginalSearchConditionsByOtherHttpMethod(HttpMethod inputType)
        {
            var handler  = new OriginalSearchManager(OriginalSearchHelpers.GetTopOriginalSearchConditionParameters(ResourceId.Client, OriginalSearchHelpers.MenuId[ResourceId.Client].ToString()));
            var response = handler.OriginalSearch <object>(inputType.ToNetHttpMethod());

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest));
        }
        public void TestTopOriginalSearchConditionsValid(ResourceId resource)
        {
            var handler  = new OriginalSearchManager(OriginalSearchHelpers.GetTopOriginalSearchConditionParameters(resource, OriginalSearchHelpers.MenuId[resource].ToString()));
            var response = handler.OriginalSearch <List <TopOriginalSearchConditonResponse> >(HttpMethod.Get);

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

            foreach (var item in response.Result)
            {
                PrAssert.That(item.Url, PrIs.Not.Null.Or.Not.Empty);
                PrAssert.That(item.Id, PrIs.GreaterThan(0));
                PrAssert.That(item.Label, PrIs.Not.Null.Or.Not.Empty);
            }
        }
Exemplo n.º 4
0
        public void TestOriginalSearchAccessEndpointConditions(AccessState accessState, HttpStatusCode httpStatusCode, ResultCode resultCode)
        {
            AccessEndpointManager accessEndpointHandler = new AccessEndpointManager();
            var response = accessEndpointHandler.AccessEndpoint <List <TopOriginalSearchConditonResponse> >(accessState, OriginalSearchHelpers.GetTopOriginalSearchConditionParameters(ResourceId.Activity, OriginalSearchHelpers.MenuId[ResourceId.Activity].ToString()), HttpMethod.Get);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(httpStatusCode).And.ErrorCode((int)resultCode), $"Still able to search original.");
        }