Example #1
0
        public async void Property_Paged_from_6_to_10()
        {
            var propertyDomain = new PropertyDomain(_fixture.GetDbContext());
            var propertyFilter = new PropertyFilter {
                Page = 1, Take = 5
            };
            var result = await propertyDomain.GetAllAsync(propertyFilter);

            Assert.True(result.Items.FirstOrDefault()?.Id == 6);
            Assert.True(result.Total == 10);
        }
Example #2
0
        public async void Property_Paged_from_1_to_5_with_ownerId()
        {
            var propertyDomain = new PropertyDomain(_fixture.GetDbContext());
            var propertyFilter = new PropertyFilter {
                Page = 0, Take = 5, OwnerId = 1
            };
            var result = await propertyDomain.GetAllAsync(propertyFilter);

            Assert.True(result.Items.FirstOrDefault()?.Id == 1);
            Assert.True(result.Total == 6);
        }
Example #3
0
        /// Converts the domain to a GraphML string representation.
        protected static string DomainToGraphML(PropertyDomain domain)
        {
            switch (domain)
            {
            case PropertyDomain.Node: return("node");

            case PropertyDomain.Arc: return("arc");

            case PropertyDomain.Graph: return("graph");

            default: return("all");
            }
        }
Example #4
0
        public static Property FromDomainModel(this Property obj, PropertyDomain domain)
        {
            if (obj == null)
            {
                obj = new Property();
            }

            obj.PropertyId = domain.PropertyId;
            obj.Name       = domain.Name;
            obj.IsActive   = domain.IsActive;

            return(obj);
        }