private void AssertPoemRequestsAreEqual(PoemRequest poemRequest, PoemRequest actualPoemRequest)
 {
     Assert.AreEqual(poemRequest.Id, actualPoemRequest.Id);
     Assert.AreEqual(poemRequest.DateSent, actualPoemRequest.DateSent);
     Assert.AreEqual(poemRequest.IsArchived, actualPoemRequest.IsArchived);
     Assert.AreEqual(poemRequest.PoemId, actualPoemRequest.PoemId);
     Assert.AreEqual(poemRequest.RequestedProfileId, actualPoemRequest.RequestedProfileId);
     Assert.AreEqual(poemRequest.SentById, actualPoemRequest.SentById);
 }
        public void SuccessfulCreateAndInsert()
        {
            IPoemRequestRepository repository = GetRepositoryWithEnrolledUnitOfWork();
            var preparedTupple = PreparePoem<LegendAuthorityType, HaikuPoem>();
            var requestedProfile = CreateAndRegisterUserProfile<NoviceAuthorityType>();
            PoemRequest poemRequest = new PoemRequest
                                      {
                                          PoemId = preparedTupple.Item2.Id,
                                          SentById = preparedTupple.Item1.Id,
                                          RequestedProfileId = requestedProfile.Id,
                                          IsArchived = false,
                                          DateSent = DateTime.UtcNow
                                      };
            RegisterDataStoreObject(poemRequest);
            var actualPoemRequest = repository.GetById(poemRequest.Id);

            AssertPoemRequestsAreEqual(poemRequest, actualPoemRequest);
        }
        public IEnumerable<PoemRequest> InsertPoemRequests(long fromUserId, long aboutPoemId, IEnumerable<long> toPlayers)
        {
            List<PoemRequest> poemRequests = new List<PoemRequest>();
            foreach (var player in toPlayers)
            {
                var request = new PoemRequest
                    {
                        RequestedProfileId = player,
                        SentById = fromUserId,
                        IsArchived = false,
                        PoemId = aboutPoemId,
                        DateSent = DateTime.UtcNow
                    };
                poemRequestRepository.Insert(request);
                poemRequests.Add(request);
            }

            poemRequestRepository.Commit();
            return poemRequests;
        }