示例#1
0
        public void CanCompile()
        {
            var technologySummaryIndex = new TechnologySummary_Index {
                Conventions = new DocumentConvention()
            };

            var indexDefinition = technologySummaryIndex.CreateIndexDefinition();

            Assert.Equal(
                "docs.Technologies\r\n\t.Where(technology => !technology.Id.EndsWith(\"/published\"))\r\n\t.Select(technology => new {TechnologyId = technology.Id, DrugId = technology.Drug.Id})",
                indexDefinition.Map);
        }
示例#2
0
        public void CanCompile()
        {
            var technologySummaryIndex = new TechnologySummary_Index();

            var indexDefinition = technologySummaryIndex.CreateIndexDefinition();

            Assert.Equal(
                @"docs.Technologies.Where(technology => !Id(technology).EndsWith(""/published"")).Select(technology => new {
    TechnologyId = Id(technology),
    DrugId = technology.Drug.Id
})".Replace("\r\n", Environment.NewLine),
                indexDefinition.Maps.First());
        }
示例#3
0
        public void CanCompile()
        {
            var technologySummaryIndex = new TechnologySummary_Index {
                Conventions = new DocumentConvention
                {
                    PrettifyGeneratedLinqExpressions = false
                }
            };

            var indexDefinition = technologySummaryIndex.CreateIndexDefinition();

            Assert.Equal(
                @"docs.Technologies.Where(technology => !technology.__document_id.EndsWith(""/published"")).Select(technology => new {
    TechnologyId = technology.__document_id,
    DrugId = technology.Drug.Id
})",
                indexDefinition.Map);
        }
示例#4
0
文件: Andrew.cs 项目: yitaom2/ravendb
        public void CanCompile()
        {
            var technologySummaryIndex = new TechnologySummary_Index
            {
                Conventions = new DocumentConventions
                {
#pragma warning disable CS0618 // Type or member is obsolete
                    PrettifyGeneratedLinqExpressions = false
#pragma warning restore CS0618 // Type or member is obsolete
                }
            };

            var indexDefinition = technologySummaryIndex.CreateIndexDefinition();

            Assert.Equal(
                @"docs.Technologies.Where(technology => !Id(technology).EndsWith(""/published"")).Select(technology => new {
    TechnologyId = Id(technology),
    DrugId = technology.Drug.Id
})".Replace("\r\n", Environment.NewLine),
                indexDefinition.Maps.First());
        }