Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public void MyTestInitialize()
        {
            transaction = new TransactionScope();

            userGroup                 = new UserGroup();
            userGroup.name            = name;
            userGroup.description     = description;
            userGroup.UserProfiles    = new List <UserProfile>();
            userGroup.Recommendations = new List <Recommendation>();

            userGroupDao.Create(userGroup);
        }