Example #1
0
        public void Should_make_query_with_null_regex()
        {
            var i = _F(ClrFilter.Contains("createdBy", null !));
            var o = _C("{ 'cb' : /null/i }");

            Assert.Equal(o, i);
        }
Example #2
0
        public async Task Should_query_assets_by_fileName(DomainId?parentId)
        {
            var query = new ClrQuery
            {
                Filter = F.Contains("FileName", _.RandomValue())
            };

            var assets = await QueryAsync(parentId, query);

            Assert.NotNull(assets);
        }
Example #3
0
        public async Task Should_query_assets_by_tags_and_name(Guid?parentId)
        {
            var query = new ClrQuery
            {
                Filter = F.And(F.Eq("Tags", _.RandomValue()), F.Contains("FileName", _.RandomValue()))
            };

            var assets = await QueryAsync(parentId, query);

            Assert.NotNull(assets);
        }
        public async Task Should_query_assets_by_fileName_and_tags(DomainId?parentId)
        {
            var random = _.RandomValue();

            var query = new ClrQuery
            {
                Filter = F.And(F.Contains("FileName", random), F.Eq("Tags", random))
            };

            var assets = await QueryAsync(parentId, query);

            Assert.NotNull(assets);
        }
Example #5
0
        public void Should_make_query_with_contains_and_invalid_character()
        {
            var filter = ClrFilter.Contains("Text", "search(");

            AssertQuery("{ 'Text' : /search\\(/i }", filter);
        }
Example #6
0
        public void Should_make_query_with_contains()
        {
            var filter = ClrFilter.Contains("Text", "search");

            AssertQuery("{ 'Text' : /search/i }", filter);
        }
Example #7
0
        public void Should_make_query_with_contains_and_null_value()
        {
            var filter = ClrFilter.Contains("Text", null !);

            AssertQuery("{ 'Text' : /null/i }", filter);
        }