Beispiel #1
0
        public void ShouldAddMember()
        {
            // Arrange
            IQueryable <Member> members = new List <Member>().AsQueryable();

            var mockset = new Mock <DbSet <Member> >();

            mockset.As <IQueryable <Member> >().Setup(m => m.Provider).Returns(members.Provider);
            mockset.As <IQueryable <Member> >().Setup(m => m.Expression).Returns(members.Expression);
            mockset.As <IQueryable <Member> >().Setup(m => m.ElementType).Returns(members.ElementType);
            mockset.As <IQueryable <Member> >().Setup(m => m.GetEnumerator()).Returns(members.GetEnumerator());

            var mockContext = new Mock <CarMeetingContext>();

            mockContext.Setup(c => c.Members).Returns(mockset.Object);

            //Act
            var repository = new MeetingRepository(mockContext.Object);
            var actual     = repository.AddLid(new Member {
                Name = "Scheers", Surname = "Kaas", City = "Dorp"
            });

            //Assert
            mockset.Verify(m => m.Add(It.IsAny <Member>()), Times.Once);
        }
Beispiel #2
0
        public void sendMeeting(string text)
        {
            if (!string.IsNullOrWhiteSpace(text))
            {
                var invite = new MeetingModel
                {
                    //Sender = sender,
                    Confirmed = false,
                    Text      = text
                };
                var meetingRepository = new MeetingRepository();
                meetingRepository.sendMeeting(invite.MapToMeeting());
                //int id = meetRep.sendMeeting(invite.MapToMeeting());
                //var test = mjau(receiver);

                //int k;
                //k = test.Length;

                //for (int s = 0; s < test.Length; s++)
                //{

                //    var blog_kat = new Category_Blog
                //    {
                //        CategoryId = test[s],
                //        BlogId = id
                //    };



                //cb_rep.Add(blog_kat);
            }
            ;
        }
Beispiel #3
0
        public void ShouldReturnMemberByUsername()
        {
            // Arrange
            IQueryable <Member> members = new List <Member>()
            {
                new Member
                {
                    Username = "******"
                },
                new Member
                {
                    Username = "******"
                }
            }
            .AsQueryable();

            var mockset = new Mock <DbSet <Member> >();

            mockset.As <IQueryable <Member> >().Setup(m => m.Provider).Returns(members.Provider);
            mockset.As <IQueryable <Member> >().Setup(m => m.Expression).Returns(members.Expression);
            mockset.As <IQueryable <Member> >().Setup(m => m.ElementType).Returns(members.ElementType);
            mockset.As <IQueryable <Member> >().Setup(m => m.GetEnumerator()).Returns(members.GetEnumerator());

            var mockContext = new Mock <CarMeetingContext>();

            mockContext.Setup(c => c.Members).Returns(mockset.Object);

            //Act
            var repository = new MeetingRepository(mockContext.Object);
            var actual     = repository.GetMemberByUsername("berend");

            //Assert
            Assert.Same(members.SingleOrDefault(x => x.Username == "berend"), actual);
        }
        public void Add_can_add_a_new_meeting()
        {
            // Arrange
            var meetingRepository = new MeetingRepository(activeSessionManager);
            var meeting = new Meeting()
                              {
                                  Title = "Test Meeting",
                                  Description = "Sample Description",
                                  StartTime = DateTime.Parse("1/1/2009"),
                                  EndTime = DateTime.Parse("1/1/2009"),
                                  Presenter = "Tim Barcz",
                                  Facility = new Facility() {
                                                                Address = new Address()
                                                                              {
                                                                                  Street = "123 Oak Street",
                                                                                  City="Cedar Rapids",
                                                                                  Region = "Iowa",
                                                                                  ZipCode = "52402"
                                                                              },
                                                                Description = "Sample Facility",
                                                                Name = "Test Facility",
                                                                ImageUrl = "http://www.google.com"
                                                            }
                              };
            // Act
            meetingRepository.Add(meeting);

            // Assert
            Assert.That(meeting.MeetingId, Is.GreaterThan(0));
        }
Beispiel #5
0
 public UnitOfWork(EasyFindPropertiesEntities dbCtx)
 {
     _dbCtx              = dbCtx;
     PropertyType        = new PropertyTypeRepository(_dbCtx);
     AdPriority          = new AdPriorityRepository(_dbCtx);
     AdType              = new AdTypeRepository(_dbCtx);
     PropertyCategory    = new PropertyCategoryRepository(_dbCtx);
     PropertyCondition   = new PropertyConditionRepository(_dbCtx);
     PropertyImage       = new PropertyImageRepository(_dbCtx);
     PropertyPurpose     = new PropertyPurposeRepository(_dbCtx);
     PropertyRating      = new PropertyRatingRepository(_dbCtx);
     Property            = new PropertyRepository(_dbCtx);
     PropertyRequisition = new PropertyRequisitionRepository(_dbCtx);
     SubscriptionType    = new SubscriptionTypeRepository(_dbCtx);
     Subscription        = new SubscriptionRepository(_dbCtx);
     TagType             = new TagTypeRepository(_dbCtx);
     Tennant             = new TennantRepository(_dbCtx);
     Owner          = new OwnerRepository(_dbCtx);
     Tags           = new TagsRepository(_dbCtx);
     Message        = new MessageRepository(_dbCtx);
     User           = new UserRepository(_dbCtx);
     UserType       = new UserTypeRepository(_dbCtx);
     UserTypeAssoc  = new UserTypeAssocRepository(_dbCtx);
     MessageTrash   = new MessageTrashRepository(_dbCtx);
     Meeting        = new MeetingRepository(_dbCtx);
     MeetingMembers = new MeetingMembersRepository(_dbCtx);
 }
Beispiel #6
0
 public HrUnitOfWork(IContextFactory <DbContext> contextFactory) // , int companyId, string culture
     : base(contextFactory)
 {
     // Initialize
     CompanyRepository          = new CompanyRepository(Context); // , companyId, culture
     PagesRepository            = new PagesRepository(Context);
     MenuRepository             = new MenuRepository(Context);
     PageEditorRepository       = new PageEditorRepository(Context);
     LookUpRepository           = new LookUpRepoitory(Context);
     CompanyStructureRepository = new CompanyStructureRepository(Context);
     JobRepository           = new JobRepository(Context);
     PeopleRepository        = new PeopleRepository(Context);
     PositionRepository      = new PositionRepository(Context);
     BudgetRepository        = new BudgetRepository(Context);
     QualificationRepository = new QualificationRepository(Context);
     LeaveRepository         = new LeaveRepository(Context);
     EmployeeRepository      = new EmployeeRepository(Context);
     CustodyRepository       = new CustodyRepository(Context);
     TrainingRepository      = new TrainingRepository(Context);
     BenefitsRepository      = new BenefitsRepository(Context);
     AudiTrialRepository     = new AudiTrialRepository(Context);
     TerminationRepository   = new TerminationRepository(Context);
     DisciplineRepository    = new DisciplineRepository(Context);
     CheckListRepository     = new CheckListRepository(Context);
     ComplaintRepository     = new ComplaintRepository(Context);
     MessageRepository       = new MessageRepository(Context);
     MedicalRepository       = new MedicalRepository(Context);
     HrLettersRepository     = new HRLettersRepository(Context);
     PayrollRepository       = new PayrollRepository(Context);
     SalaryDesignRepository  = new SalaryDesignRepository(Context);
     NotificationRepository  = new NotificationRepository(Context);
     MissionRepository       = new MissionRepository(Context);
     MeetingRepository       = new MeetingRepository(Context);
 }
Beispiel #7
0
        protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
        {
            _container = container;

            var configuration = new HostConfiguration()
            {
                UrlReservations = { CreateAutomatically = true }
            };

            container.Register(configuration);

            //register dependencies

            IRepository <User>    userRepository    = new UserRepository(_mongoEndpoint);
            IRepository <Meeting> meetingRepository = new MeetingRepository(_mongoEndpoint);

            IUserService    userService    = new UserService(userRepository);
            IMeetingService meetingService = new MeetingService(meetingRepository, userService);

            container.Register(userService);
            container.Register(meetingService);

            pipelines.AfterRequest += (ctx) =>
            {
                ctx.Response.Headers.Add("Access-Control-Allow-Origin", "*");
                ctx.Response.Headers.Add("Access-Control-Allow-Methods", "POST,GET,PUT,DELETE,OPTIONS");
                ctx.Response.Headers.Add("Access-Control-Allow-Headers", "Accept, Origin, Content-type,Authorization");
            };

            base.ApplicationStartup(container, pipelines);
        }
Beispiel #8
0
        private static void Main(string[] args)
        {
            // Dependencies
            var meetingRepository = new MeetingRepository();
            var meetingInteractor = new MeetingInteractor(meetingRepository);

            // Jobs
            var jobs = new List <IJob>
            {
                new MeetingReminderJob(meetingRepository)
            };

            StartJobs(jobs);

            // Commands
            var commands = new List <ICommand>
            {
                new CreateMeetingCommand(meetingRepository, meetingInteractor),
                new EditMeetingCommand(meetingRepository, meetingInteractor),
                new ShowMeetingsCommand(meetingRepository),
                new ExportMeetingsCommand(meetingRepository)
            };

            while (true)
            {
                ConsoleUtils.WriteInvite("Выберите комманду");
                var command = ConsoleUtils.ItemSelector(commands, "Некорректный номер команды");
                command.DoAction();
            }
        }
        private void DayMeetings(string year, string month, string day)
        {
            MeetingRepository mr   = new MeetingRepository();
            string            date = "";

            if (Convert.ToInt32(month) < 10)
            {
                date = year + "-0" + month + "-";
            }
            else
            {
                date = year + "-" + month + "-";
            }
            if (Convert.ToInt32(day) < 10)
            {
                date += "0" + day;
            }
            else
            {
                date += day;
            }
            List <Meeting> meetings = new List <Meeting>();

            meetings = mr.GetAllConfirmedMeetingsDay(date);
            dayModel = new DayViewModels
            {
                Year     = Convert.ToInt32(year),
                Month    = Convert.ToInt32(month),
                Day      = Convert.ToInt32(day),
                Meetings = meetings,
                Notes    = null
            };
        }
Beispiel #10
0
        public void ShouldAddClub()
        {
            // Arrange
            IQueryable <Club> clubs = new List <Club>().AsQueryable();

            var mockset = new Mock <DbSet <Club> >();

            mockset.As <IQueryable <Club> >().Setup(m => m.Provider).Returns(clubs.Provider);
            mockset.As <IQueryable <Club> >().Setup(m => m.Expression).Returns(clubs.Expression);
            mockset.As <IQueryable <Club> >().Setup(m => m.ElementType).Returns(clubs.ElementType);
            mockset.As <IQueryable <Club> >().Setup(m => m.GetEnumerator()).Returns(clubs.GetEnumerator());

            var mockContext = new Mock <CarMeetingContext>();

            mockContext.Setup(c => c.Clubs).Returns(mockset.Object);

            //Act
            var repository = new MeetingRepository(mockContext.Object);
            var actual     = repository.AddClub(new Club {
                Name = "Testclub", Contact = "niemand", Photo = "no photo", Description = "lala"
            });

            //Assert
            mockset.Verify(m => m.Add(It.IsAny <Club>()), Times.Once);
        }
        private static List <MeetingInvitationsViewModels> FetchInvitedMeetings(string userID)
        {
            MeetingRepository mr = new MeetingRepository();
            var list             = mr.GetInvitedMeetings(userID);
            List <MeetingInvitationsViewModels> meetings = new List <MeetingInvitationsViewModels>();

            foreach (Meeting meeting in list)
            {
                var user     = mr.GetMeetingCreator(meeting.MID);
                var answered = mr.GetAnswer(meeting.MID, userID);
                var mod      = new MeetingInvitationsViewModels
                {
                    Subject   = meeting.Subject,
                    Place     = meeting.Place,
                    Date      = meeting.Date,
                    MeetingID = meeting.MID,
                    Sender    = user.FirstName + user.LastName,
                    Answered  = answered,
                    Confirmed = meeting.Confirmed
                };
                meetings.Add(mod);
            }

            return(meetings);
        }
Beispiel #12
0
        public async Task AuthenticateOk()
        {
            IConfigurationBuilder configurationBuilder = new ConfigurationBuilder();

            configurationBuilder.AddJsonFile("appSettings.json");

            IConfiguration configuration = configurationBuilder.Build();

            var repository     = new MeetingRepository(configuration);
            var weatherService = new WeatherService();

            IOptions <PaginationOptions> options = Options.Create(new PaginationOptions());

            var meetingController = new MeetingController(
                new MeetingService(repository, weatherService, options));

            var user = new UserLoginDto
            {
                Username = "******",
                Password = "******"
            };
            var userRepo    = new UserRepository(configuration);
            var userService = new UserService(userRepo, options);

            var authController = new AuthenticationController(configuration, userService);

            var token = await authController.Authenticate(user);

            Assert.AreEqual(token.GetType(), typeof(OkObjectResult));

            await Task.CompletedTask;
        }
Beispiel #13
0
        protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
        {
            _container = container;

            var configuration = new HostConfiguration() { UrlReservations = { CreateAutomatically = true } };
            container.Register(configuration);

            //register dependencies

            IRepository<User> userRepository = new UserRepository(_mongoEndpoint);
            IRepository<Meeting> meetingRepository = new MeetingRepository(_mongoEndpoint);

            IUserService userService = new UserService(userRepository);
            IMeetingService meetingService = new MeetingService(meetingRepository,userService);

            container.Register(userService);
            container.Register(meetingService);

            pipelines.AfterRequest += (ctx) =>
            {
                ctx.Response.Headers.Add("Access-Control-Allow-Origin", "*");
                ctx.Response.Headers.Add("Access-Control-Allow-Methods", "POST,GET,PUT,DELETE,OPTIONS");
                ctx.Response.Headers.Add("Access-Control-Allow-Headers", "Accept, Origin, Content-type,Authorization");
            };

            base.ApplicationStartup(container, pipelines);
        }
Beispiel #14
0
        public Meeting GetMeetingById(Guid meetingId)
        {
            Meeting meeting = MeetingRepository.GetById(meetingId);

            ValidateIfMeetingExists(meeting);

            return(meeting);
        }
        public ActionResult ConfirmMeeting(int meetingID, string time)
        {
            MeetingRepository mr = new MeetingRepository();

            mr.SetMeetingConfirmed(meetingID);
            mr.SetTimeSuggestionConfirmed(meetingID, time);
            return(RedirectToAction("ViewMeetings"));
        }
Beispiel #16
0
 public WebAPIController()
 {
     blogRep = new BlogEntryRepository();
     cb_rep  = new Category_BlogRepository();
     fileRep = new FileRepository();
     userRep = new UserRepository();
     meetRep = new MeetingRepository();
 }
Beispiel #17
0
 public Meeting AddOrUpdate(Meeting entity)
 {
     if (entity != null)
     {
         RaceRepository.AddOrUpdate(entity.Races);
     }
     return(MeetingRepository.AddOrUpdate(entity));
 }
Beispiel #18
0
 public IEnumerable <Meeting> AddOrUpdate(IEnumerable <Meeting> list)
 {
     foreach (var meeting in list)
     {
         RaceRepository.AddOrUpdate(meeting.Races);
     }
     return(MeetingRepository.AddOrUpdate(list));
 }
Beispiel #19
0
        public Meeting CreateMeeting(Guid userId)
        {
            IEnumerable <TemplateQuestion> questions = TemplateQuestionRepository.GetAll();

            Meeting meeting = new Meeting(userId, questions);

            MeetingRepository.Insert(meeting);

            return(meeting);
        }
Beispiel #20
0
        public ActionResult AddNewInvitation(MeetingViewModel model)
        {
            Invitation newInvitation = new Invitation();

            newInvitation.Meeting  = MeetingRepository.Get(model.MeetingId);
            newInvitation.Notified = false;
            newInvitation.User     = UserRepository.Get(model.UserId);
            newInvitation.Status   = 0;
            InvitationRepository.Add(newInvitation);
            return(RedirectToAction("Profile", new { id = model.MeetingId }));
        }
        public void Can_load_all_meetings()
        {
            // Arrange
            var meetingRepository = new MeetingRepository(activeSessionManager);

            // Assert
            IList<Meeting> meetings = meetingRepository.GetAllMeetings();

            // Act
            Assert.That(meetings.Count, Is.EqualTo(8));
        }
Beispiel #22
0
        public async Task <ActionResult> AddConfirmedTime(int id)
        {
            Time    timeChosen = TimeRepository.Get(id);
            Meeting meeting    = MeetingRepository.Get(timeChosen.Meeting.Id);

            meeting.ConfirmedTime = timeChosen.Date;
            MeetingRepository.Update(meeting);
            await sendMeetingUpdateMail(meeting);

            return(RedirectToAction("Profile", new { id = meeting.Id }));
        }
Beispiel #23
0
 public EditMeetingCommand(MeetingRepository meetingRepository,
                           MeetingInteractor meetingInteractor)
 {
     _meetingRepository  = meetingRepository;
     _meetingEditActions = new List <EditMeetingActionBase>
     {
         new ChangeMeetingNameCommand(),
         new ChangeStartDateMeetingEditAction(meetingInteractor),
         new ChangeEndDateMeetingEditAction(meetingInteractor),
         new EditRemindersMeetingEditAction()
     };
 }
        public void Setup()
        {
            _userRepo            = new UserRepository();
            _connectionNotifRepo = new ConnectionNotificationRepository();
            _eventRepo           = new EventRepository();
            _meetingRepo         = new MeetingRepository();
            _meetingRequestRepo  = new MeetingRequestRepository();

            _userService    = new UserService(_userRepo, _connectionNotifRepo);
            _eventService   = new EventService(_eventRepo);
            _meetingService = new MeetingService(_meetingRepo, _meetingRequestRepo);
        }
        public RepositoryProvider(ScrummyDatabase database)
        {
            _database = database;

            Person   = new PersonRepository(_database.PersonCollection);
            Project  = new ProjectRepository(_database.ProjectCollection, _database.MeetingCollection, _database.SprintCollection, _database.WorkTaskCollection, _database.DocumentCollection);
            Team     = new TeamRepository(_database.TeamCollection);
            Meeting  = new MeetingRepository(_database.MeetingCollection);
            Sprint   = new SprintRepository(_database.SprintCollection, _database.ProjectCollection);
            WorkTask = new WorkTaskRepository(_database.WorkTaskCollection);
            Document = new DocumentRepository(_database.DocumentCollection, _database.SprintCollection, _database.MeetingCollection, _database.WorkTaskCollection);
        }
        // GET: /Edit
        public ActionResult Edit(int id)
        {
            //Get Item From Database
            PolicyGroup group = new PolicyGroup();

            group = policyGroupRepository.GetGroup(id);

            //Check Exists
            if (group == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }
            //Check Access
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToPolicyGroup(id))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }
            TripTypeRepository tripTypeRepository = new TripTypeRepository();
            SelectList         tripTypesList      = new SelectList(tripTypeRepository.GetAllTripTypes().ToList(), "TripTypeId", "TripTypeDescription");

            ViewData["tripTypes"] = tripTypesList;

            GDSRepository gdsRepository = new GDSRepository();
            SelectList    gDSList       = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName");

            ViewData["GDSs"] = gDSList;

            PNROutputTypeRepository pNROutputTypeRepository = new PNROutputTypeRepository();
            SelectList pNROutputTypeList = new SelectList(pNROutputTypeRepository.GetAllPNROutputTypes().ToList(), "PNROutputTypeId", "PNROutputTypeName");

            ViewData["PNROutputTypes"] = pNROutputTypeList;

            TablesDomainHierarchyLevelRepository tablesDomainHierarchyLevelRepository = new TablesDomainHierarchyLevelRepository();
            SelectList hierarchyTypesList = new SelectList(tablesDomainHierarchyLevelRepository.GetDomainHierarchies(groupName).ToList(), "HierarchyLevelTableName", "HierarchyLevelTableName");

            ViewData["HierarchyTypes"] = hierarchyTypesList;

            policyGroupRepository.EditGroupForDisplay(group);

            //Meetings
            MeetingRepository meetingRepository = new MeetingRepository();
            List <Meeting>    meetings          = meetingRepository.GetAvailableMeetings(group.HierarchyType, group.HierarchyCode, null, group.SourceSystemCode, group.TravelerTypeGuid);
            SelectList        meetingsList      = new SelectList(meetings.ToList(), "MeetingID", "MeetingDisplayName", group.MeetingID != null ? group.MeetingID.ToString() : "");

            ViewData["Meetings"] = meetingsList;

            return(View(group));
        }
        public void GetMeetingsBetween_returns_one_meeting()
        {
            // Arrange
            var meetingRepository = new MeetingRepository(activeSessionManager);
            var startDate = DateTime.Parse("1/1/2008");
            var endDate = DateTime.Parse("1/1/2009");

            // Act
            IList<Meeting> meetings = meetingRepository.GetMeetingsBetween(startDate, endDate);

            // Assert
            Assert.That(meetings.Count, Is.EqualTo(2));
        }
        //GET: CalendarApi
        public IHttpActionResult Get()
        {
            var meetingList = MeetingRepository.Get();
            var eventList   = meetingList.Select(item => new Event
            {
                Id            = item.Id,
                Title         = item.Title,
                ConfirmedTime = item.ConfirmedTime
            }).ToList();


            return(Json(eventList));
        }
Beispiel #29
0
        public void ShouldReturnAllMembersByClubID()
        {
            //Arrange
            IQueryable <Member> members = new List <Member>
            {
                new Member
                {
                    Name    = "Gert",
                    Surname = "Scheers",
                    ClubId  = 1
                },
                new Member
                {
                    Name    = "Bjorn",
                    Surname = "Scheers",
                    ClubId  = 1
                },
                new Member
                {
                    Name    = "Gert",
                    Surname = "Hesp",
                    ClubId  = 1
                },
                new Member
                {
                    Name    = "Gert",
                    Surname = "Kaas",
                    ClubId  = 2
                }
            }
            .AsQueryable();

            var mockset = new Mock <DbSet <Member> >();

            mockset.As <IQueryable <Member> >().Setup(m => m.Provider).Returns(members.Provider);
            mockset.As <IQueryable <Member> >().Setup(m => m.Expression).Returns(members.Expression);
            mockset.As <IQueryable <Member> >().Setup(m => m.ElementType).Returns(members.ElementType);
            mockset.As <IQueryable <Member> >().Setup(m => m.GetEnumerator()).Returns(members.GetEnumerator());

            var mockContext = new Mock <CarMeetingContext>();

            mockContext.Setup(c => c.Members).Returns(mockset.Object);

            //Act
            var repository = new MeetingRepository(mockContext.Object);
            var actual     = repository.GetMembersByClubId(1);

            //Assert
            Assert.Equal(members.Count(x => x.ClubId == 1), actual.Count());
        }
Beispiel #30
0
        static void Main(string[] args)
        {
            IMeetingRepository meetingRepository = new MeetingRepository(new MeetingContext());
            var horses = meetingRepository.GetHorses();

            Console.WriteLine("List of Horses order by Prices are");
            Console.WriteLine("==================================");
            foreach (var horse in horses)
            {
                Console.WriteLine(horse.name + "-" + horse.Price);
            }
            Console.Write("Press any key to exit:");
            Console.Read();
        }
        // GET: /View
        public ActionResult Edit(int id)
        {
            QueueMinderGroup queueMinderGroup = new QueueMinderGroup();

            queueMinderGroup = queueMinderGroupRepository.GetGroup(id);

            //Check Exists
            if (queueMinderGroup == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToQueueMinderGroup(id))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            if (queueMinderGroup.TripTypeId == null)
            {
                TripType tripType = new TripType();
                queueMinderGroup.TripType = tripType;
            }

            QueueMinderGroupVM queueMinderGroupVM = new QueueMinderGroupVM();

            queueMinderGroupRepository.EditGroupForDisplay(queueMinderGroup);
            queueMinderGroupVM.QueueMinderGroup = queueMinderGroup;

            TripTypeRepository tripTypeRepository = new TripTypeRepository();
            SelectList         tripTypesList      = new SelectList(tripTypeRepository.GetAllTripTypes().ToList(), "TripTypeId", "TripTypeDescription");

            queueMinderGroupVM.TripTypes = tripTypesList;

            TablesDomainHierarchyLevelRepository tablesDomainHierarchyLevelRepository = new TablesDomainHierarchyLevelRepository();
            SelectList hierarchyTypesList = new SelectList(tablesDomainHierarchyLevelRepository.GetDomainHierarchies(groupName).ToList(), "HierarchyLevelTableName", "HierarchyLevelTableName");

            queueMinderGroupVM.HierarchyTypes = hierarchyTypesList;

            //Meetings
            MeetingRepository meetingRepository = new MeetingRepository();
            List <Meeting>    meetings          = meetingRepository.GetAvailableMeetings(queueMinderGroup.HierarchyType, queueMinderGroup.HierarchyCode, null, queueMinderGroup.SourceSystemCode, queueMinderGroup.TravelerTypeGuid);
            SelectList        meetingsList      = new SelectList(meetings.ToList(), "MeetingID", "MeetingDisplayName", queueMinderGroup.MeetingID != null ? queueMinderGroup.MeetingID.ToString() : "");

            ViewData["Meetings"] = meetingsList;

            return(View(queueMinderGroupVM));
        }
Beispiel #32
0
        public DalTestContextSpecification()
        {
            LocationRetriever = new MeetingRepository(ConfigurationManager.ConnectionStrings["RyanLaptop"].ConnectionString);
            MeetingScheduler  = new MeetingRepository(ConfigurationManager.ConnectionStrings["RyanLaptop"].ConnectionString);
            MeetingRetriever  = new MeetingRepository(ConfigurationManager.ConnectionStrings["RyanLaptop"].ConnectionString);
            UserRetriever     = new UserRepository(ConfigurationManager.ConnectionStrings["RyanLaptop"].ConnectionString);
            UserSaver         = new UserRepository(ConfigurationManager.ConnectionStrings["RyanLaptop"].ConnectionString);

            //LocationRetriever = new MeetingRepository(ConfigurationManager.ConnectionStrings["Ryan7DMS"].ConnectionString);
            //MeetingScheduler = new MeetingRepository(ConfigurationManager.ConnectionStrings["Ryan7DMS"].ConnectionString);
            //MeetingRetriever = new MeetingRepository(ConfigurationManager.ConnectionStrings["Ryan7DMS"].ConnectionString);
            //UserRetriever = new UserRepository(ConfigurationManager.ConnectionStrings["Ryan7DMS"].ConnectionString);
            //UserSaver = new UserRepository(ConfigurationManager.ConnectionStrings["Ryan7DMS"].ConnectionString);
        }
        public ActionResult AnswerMeeting(int meetingID, int answer, List <string> times)
        {
            MeetingRepository rm     = new MeetingRepository();
            string            userID = User.Identity.GetUserId();

            rm.SetMeetingAnswer(answer, meetingID, userID);
            if (answer == 1)
            {
                foreach (string time in times)
                {
                    rm.SetTimeAnswer(meetingID, time, userID);
                }
            }
            return(RedirectToAction("ViewMeetings"));
        }
        public void Can_get_meeting_by_Id()
        {
            // Arrange
            var meetingRepository = new MeetingRepository(activeSessionManager);

            // Act
            var meeting = meetingRepository.GetById(1);

            // Assert
            Assert.That(meeting.MeetingId, Is.EqualTo(1));
            Assert.That(meeting.Facility.Name, Is.EqualTo("Baymont Inn"));
            Assert.That(meeting.AttendeeCount, Is.EqualTo(3));
            Assert.That(meeting.Attendees.OfType<GuestAttendee>().Count(), Is.EqualTo(1));
            Assert.That(meeting.Attendees.Count(x=>x.GetType() == typeof(MemberAttendee)), Is.EqualTo(1));
            Assert.That(meeting.Attendees.OfType<PromotedAttendee>().Count(), Is.EqualTo(1));
        }
        public PartialViewResult ConfirmMeeting(int meetingID)
        {
            MeetingRepository mr           = new MeetingRepository();
            var meeting                    = mr.GetMeeting(meetingID);
            Dictionary <string, int> times = mr.GetAnsweredTimes(meetingID);
            var model = new ConfirmMeetingViewModels
            {
                Subject   = meeting.Subject,
                Place     = meeting.Place,
                Date      = meeting.Date,
                meetingID = meeting.MID,
                Times     = times
            };

            return(PartialView("_ConfirmMeetingPartial", model));
        }
        public void GetUpcomingMeetings_should_return_two_results()
        {
            // Arrange
            var meetingRepository = new MeetingRepository(activeSessionManager);

            // Act
            var meetings = meetingRepository.GetUpcomingMeetings(DateTime.Parse("2008-07-04"),2);

            // Assert
            Assert.That(meetings.Count, Is.EqualTo(2));
            Assert.That(meetings[0].MeetingId, Is.EqualTo(1), "Meeting id does not match expected value");
            Assert.That(meetings[1].MeetingId, Is.EqualTo(4), "Meeting id does not match expected value");
        }
        public void MeetingRepository_can_save_Attendees()
        {
            // Arrange
            var meetingRepository = new MeetingRepository(activeSessionManager);
            var meeting = meetingRepository.GetById(2);
            meeting.AddGuestAttendee("*****@*****.**", "Chris", "Missal");
            meeting.AddGuestAttendee("*****@*****.**", "Chris", "Missal");

            // Act
            meetingRepository.Update(meeting);

            // Assert
            Assert.That(meeting.AttendeeCount, Is.EqualTo(2));
        }
        public void GetNextMeeting_should_return_the_next_meeting_after_the_date_specified()
        {
            // Arrange
            var meetingRepository = new MeetingRepository(activeSessionManager);

            // Act
            var meeting = meetingRepository.GetNextMeeting(DateTime.Parse("2008-07-04"));

            // Assert
            Assert.That(meeting.MeetingId, Is.EqualTo(1));
            Assert.That(meeting.Description, Is.EqualTo("This is the description"));
            Assert.That(meeting.Title, Is.EqualTo("Test Meeting"));
            Assert.That(meeting.Presenter, Is.EqualTo("Tim Barcz"));
            Assert.That(meeting.Facility.FacilityId, Is.EqualTo(1));
        }