Esempio n. 1
0
 protected override bool Match(TestTarget target, HttpRequestMessage request)
 {
     if (TestDefinition == null)
     {
         return true;
     }
     return cachedResults.GetOrAdd(target,
                                   t => target.ResolveDependency(TestDefinition.TestType)
                                              .IfTypeIs<IApplyToApplication>()
                                              .Then(test => test.AppliesToApplication(t.Application))
                                              .Else(() => false));
 }
 protected override bool Match(TestTarget target, HttpRequestMessage request)
 {
     if (TestDefinition == null)
     {
         return(true);
     }
     return(cachedResults.GetOrAdd(target,
                                   t => target.ResolveDependency(TestDefinition.TestType)
                                   .IfTypeIs <IApplyToApplication>()
                                   .Then(test => test.AppliesToApplication(t.Application))
                                   .Else(() => false)));
 }
Esempio n. 3
0
        protected override bool Match(TestTarget target, HttpRequestMessage request)
        {
            _tags = _tags ?? (_tags = target.ResolveDependency(TestDefinition.TestType)
                                            .IfTypeIs<IHaveTags>()
                                            .Then(test =>
                                            {
                                                var tags = test.Tags;
                                                TestDefinition.Tags = tags;
                                                return tags;
                                            })
                                            .ElseDefault()
                                            .OrEmpty()
                                            .ToArray());

            return DoTestsMatchFilterRequest(_tags, request.GetQueryNameValuePairs().ToArray());
        }
Esempio n. 4
0
        protected override bool Match(TestTarget target, HttpRequestMessage request)
        {
            _tags = _tags ?? (_tags = target.ResolveDependency(TestDefinition.TestType)
                                      .IfTypeIs <IHaveTags>()
                                      .Then(test =>
            {
                var tags = test.Tags;
                TestDefinition.Tags = tags;
                return(tags);
            })
                                      .ElseDefault()
                                      .OrEmpty()
                                      .ToArray());

            return(DoTestsMatchFilterRequest(_tags, request.GetQueryNameValuePairs().ToArray()));
        }
Esempio n. 5
0
        protected override bool Match(TestTarget target, HttpRequestMessage request)
        {
            if (TestDefinition == null)
            {
                return(true);
            }
            var key = string.Format("{0}{1}:{2}:{3}", "TargetConstraint:", target.Environment, target.Application, TestDefinition.TestType);

            return(HttpRuntime.Cache.GetOrAdd(key,
                                              () =>
            {
                var test = target.ResolveDependency(TestDefinition.TestType) as IApplyToTarget;

                return test.IfNotNull()
                .Then(t => t.AppliesToTarget(target))
                .ElseDefault();
            }));
        }
Esempio n. 6
0
        internal bool Match(TestTarget target)
        {
            if (TestDefinition == null)
            {
                return(true);
            }

            var key = string.Format("{0}({1}:{2}):{3}", "TargetConstraint:", target.Environment, target.Application, TestDefinition.TestType);

            Func <bool> resolve = () =>
            {
                var test = target.ResolveDependency(TestDefinition.TestType);

                return(test.IfTypeIs <IApplyToTarget>()
                       .Then(t => t.AppliesToTarget(target))
                       .ElseDefault());
            };

            return(HttpRuntime.Cache.GetOrAdd(key, resolve));
        }
Esempio n. 7
0
        internal bool Match(TestTarget target)
        {
            if (TestDefinition == null)
            {
                return true;
            }

            var key = $"{"TargetConstraint:"}({target.Environment}:{target.Application}):{TestDefinition.TestType}";

            Func<bool> resolve = () =>
            {
                var test = target.ResolveDependency(TestDefinition.TestType);

                return test.IfTypeIs<IApplyToTarget>()
                           .Then(t => t.AppliesToTarget(target))
                           .ElseDefault();
            };

            return HttpRuntime.Cache.GetOrAdd(key, resolve);
        }
Esempio n. 8
0
 protected abstract bool Match(TestTarget target, HttpRequestMessage request);
Esempio n. 9
0
 protected abstract bool Match(TestTarget target, HttpRequestMessage request);
Esempio n. 10
0
 protected override bool Match(TestTarget target, HttpRequestMessage _)
 {
     return(Match(target));
 }
Esempio n. 11
0
 protected override bool Match(TestTarget target, HttpRequestMessage _) =>
     Match(target);