public void MyTestInitialize() { transaction = new TransactionScope(); userProfile = new UserProfile(); userProfile.loginName = userLoginName; userProfile.enPassword = PasswordEncrypter.Crypt(clearPassword); userProfile.firstName = firstName; userProfile.lastName = lastName; userProfile.email = email; userProfile.language = language; userProfile.country = country; userProfileDao.Create(userProfile); category = new Category(); category.name = categoryName; categoryDao.Create(category); myEvent = new Event(); myEvent.categoryId = categoryId; myEvent.name = name; myEvent.eventDate = date; myEvent.review = review; myEvent.Category = category; myEvent.Comments = new List <Comment>(); myEvent.Recommendations = new List <Recommendation>(); eventDao.Create(myEvent); userGroup = new UserGroup(); userGroup.name = groupName; userGroup.description = groupDescription; userGroup.UserProfiles = new List <UserProfile>(); userGroup.UserProfiles.Add(userProfile); userGroup.Recommendations = new List <Recommendation>(); userGroupDao.Create(userGroup); recommendation1 = new Recommendation(); recommendation1.reason = recom; recommendation1.Event = myEvent; recommendation1.UserProfile = userProfile; recommendation1.UserGroup = userGroup; recommendation1.created = DateTime.Now; recommendationDao.Create(recommendation1); recommendation2 = new Recommendation(); recommendation2.Event = myEvent; recommendation2.reason = recom; recommendation2.UserProfile = userProfile; recommendation2.UserGroup = userGroup; recommendation2.created = DateTime.Now; recommendationDao.Create(recommendation2); }
public void MyTestInitialize() { transaction = new TransactionScope(); userProfile = new UserProfile(); userProfile.loginName = userLoginName; userProfile.enPassword = PasswordEncrypter.Crypt(clearPassword); userProfile.firstName = firstName; userProfile.lastName = lastName; userProfile.email = email; userProfile.language = language; userProfile.country = country; userProfileDao.Create(userProfile); category = new Category(); category.name = categoryName; categoryDao.Create(category); myEvent = new Event(); myEvent.categoryId = categoryId; myEvent.name = name; myEvent.eventDate = date; myEvent.review = review; myEvent.Category = category; myEvent.Comments = new List <Comment>(); myEvent.Recommendations = new List <Recommendation>(); eventDao.Create(myEvent); label = new Label(); label.name = categoryName; labelDao.Create(label); comment = new Comment(); comment.content = content; comment.Event = myEvent; comment.Labels = new List <Label>(); comment.loginName = userProfile.loginName; comment.UserProfile = userProfile; comment.commentDate = DateTime.Now; commentDao.Create(comment); comment2 = new Comment(); comment2.content = content; comment2.Event = myEvent; comment2.Labels = new List <Label>(); comment2.Labels.Add(label); comment2.loginName = userProfile.loginName; comment2.UserProfile = userProfile; comment2.commentDate = date; commentDao.Create(comment2); }
public void AddRecommendationTest() { using (TransactionScope scope = new TransactionScope()) { ICollection <long> groups = new List <long>(); long a = userService.RegisterUser("Patata", clearPassword, new UserProfileDetails(firstName, lastName, email, language, country)); Category category = new Category(); category.name = categoryName; categoryDao.Create(category); Event myEvent = new Event(); myEvent.categoryId = category.categoryId; myEvent.name = name; myEvent.eventDate = date; myEvent.review = review; myEvent.Category = category; eventDao.Create(myEvent); ICollection <Recommendation> r = userService.AddRecommendation(myEvent.eventId, groups, a, "hola"); Assert.AreEqual(r.Count, 0); } }
public void MyTestInitialize() { transaction = new TransactionScope(); category = new Category(); category.name = categoryName; categoryDao.Create(category); myEvent = new Event(); myEvent.categoryId = categoryId; myEvent.name = name; myEvent.eventDate = date; myEvent.review = review; myEvent.Category = category; myEvent.Comments = new List <Comment>(); myEvent.Recommendations = new List <Recommendation>(); eventDao.Create(myEvent); }