Beispiel #1
0
        public static BlogEntitiesResult UniqueEntityWithForeignEntities(
            Guid newUserId,
            Guid newChannelId,
            Guid newQueueId,
            Guid newBlogId = default(Guid))
        {
            var random  = new Random();
            var creator = UserTests.UniqueEntity(random);

            creator.Id = newUserId;

            var blog = UniqueEntity(random);

            if (newBlogId != default(Guid))
            {
                blog.Id = newBlogId;
            }

            blog.Creator   = creator;
            blog.CreatorId = creator.Id;

            var channel = ChannelTests.UniqueEntity(random);

            channel.Id     = newChannelId;
            channel.Blog   = blog;
            channel.BlogId = blog.Id;

            var queue = QueueTests.UniqueEntity(random);

            queue.Id     = newQueueId;
            queue.Blog   = blog;
            queue.BlogId = blog.Id;

            return(new BlogEntitiesResult(creator, blog, channel, queue));
        }
        private void CreateQueues(Blog blog, List <Queue> userQueues)
        {
            for (var i = 0; i < CollectionsPerChannel; i++)
            {
                var queue = QueueTests.UniqueEntity(Random);
                queue.Blog   = blog;
                queue.BlogId = blog.Id;
                this.queues.Add(queue);
                userQueues.Add(queue);

                // At least one weekly release time is required per collection.
                var weeklyReleaseTime = WeeklyReleaseTimeTests.UniqueEntity(Random, queue.Id);
                this.weeklyReleaseTimes.Add(weeklyReleaseTime);
            }
        }