public static DiscussionInterest Create(Discussion discussion, Guid interestId)
 {
     return new DiscussionInterest()
     {
         Discussion = discussion,
         Discussion_Id = discussion.Id,
         Interest_Id = interestId
     };
 }
        public void Setup()
        {
            _discussionRepository = new DiscussionRepository();

            var user = User.CreateUser("*****@*****.**");

            var interests = new List<Interest> {Interest.CreateInterest("General")};

            var discussion = Discussion.CreateDiscussion("Test", "Hello world!", user, interests, true, null);

            var post = Post.CreatePost("Foo bar", user);

            discussion.AddPost(post);
            _expecteDiscussion = discussion;

            Context.DiscussionRepository.Add(discussion);

            Context.Save();
        }
Ejemplo n.º 3
0
        public static Discussion CreateDiscussion(string title, string description, User user, List<Interest> interests, bool receiveUpdates, Area area)
        {
            var discussion = new Discussion()
            {
                Id = Guid.NewGuid(),
                Title = title,
                Description = description,
                CreatedBy_Id = user.Id,
                CreatedBy = user,
                CreatedOn = DateTime.Now.ToUniversalTime(),
                Interests = interests,
                ReceiveUpdates = receiveUpdates,
                Votes = 0,
                Views = 0,
                PostCount = 0,
                Posts = new List<Post>(),
                Area = area
            };

            discussion.DiscussionInterests = interests.Select(interest => DiscussionInterest.Create(discussion, interest.Id)).ToList();

            return discussion;
        }
Ejemplo n.º 4
0
 public void SetDiscussion(Discussion discussion)
 {
     Discussion = discussion;
 }
 public void Put(Discussion discussion)
 {
 }