Beispiel #1
0
        public void Find_FromRepository_IsComplete()
        {
            // FIXME: Remove (dummy test)
            // Arrange
            var facet    = CreateFacet("result_facet");
            var expected = new Facet()
            {
                FacetId          = 1,
                FacetCode        = "result_facet",
                DisplayTitle     = "Analysis entities",
                FacetGroupId     = 999,
                FacetTypeId      = (EFacetType)1,
                CategoryIdExpr   = "tbl_analysis_entities.analysis_entity_id",
                CategoryNameExpr = "tbl_physical_samples.sample_name||' '||tbl_datasets.dataset_name",
                SortExpr         = "tbl_datasets.dataset_name",
                IsApplicable     = false,
                IsDefault        = false,
                AggregateType    = "count",
                AggregateTitle   = "Number of samples",
                AggregateFacetId = 0
            };

            // Assert
            Asserter.EqualByProperty(facet, expected);
        }
        public void Get_ByFacetCode_Success()
        {
            var repository = Registry.Facets;

            Facet facet = repository.GetByCode("species");

            Dictionary <string, object> expectedProperties = new Dictionary <string, object>()
            {
                { "FacetId", 25 },
                { "FacetCode", "species" },
                { "DisplayTitle", "Taxa" },
                { "FacetGroupId", 6 },
                { "FacetTypeId", EFacetType.Discrete },
                { "CategoryIdExpr", "tbl_taxa_tree_master.taxon_id" },
                { "CategoryNameExpr", "concat_ws(' ', tbl_taxa_tree_genera.genus_name, tbl_taxa_tree_master.species, tbl_taxa_tree_authors.author_name)" },
                { "SortExpr", "tbl_taxa_tree_genera.genus_name||' '||tbl_taxa_tree_master.species" },
                { "IsApplicable", true },
                { "IsDefault", false },
                { "AggregateType", "sum" },
                { "AggregateTitle", "sum of Abundance" },
                { "AggregateFacetId", 32 }
            };

            Asserter.EqualByProperty(expectedProperties, facet);

            Assert.NotNull(facet.FacetGroup);
            Assert.NotNull(facet.TargetTable);
            Assert.NotNull(facet.FacetType);
            Assert.NotNull(facet.Tables);

            Assert.True(facet.Tables.Count > 0);
        }
        public void Clone_OfAnyEdge_HasSameState()
        {
            // Arrange
            var graphEdge = this.CreateGraphEdge();

            // Act
            var result = graphEdge.Clone();

            // Assert
            Asserter.EqualByProperty(graphEdge, result);
        }