Пример #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
        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());
        }