Ejemplo n.º 1
0
        public void CanGetCreatedEvent()
        {
            var eventRepository = MockRepository.GenerateStub<IEventRepository>();
            var expectedEventDto = new EventDto
            {
                EventId = 1
            };
            eventRepository
                .Expect(et => et.GetItem(1))
                .Return(expectedEventDto);

            var permissionRepository = new PermissionRepository();
            var personRepository = new PersonRepository(permissionRepository, new ChurchRepository());
            var usernamePasswordRepository = new UsernamePasswordRepository(permissionRepository);
            var groupRepository = new GroupRepository();
            var messageRepository = new MessageRepository();
            var messageRecepientRepository = new MessageRecepientRepository();
            var messageAttachmentRepository = new MessageAttachmentRepository();
            var emailSender = new EmailSender(messageRepository, messageRecepientRepository, messageAttachmentRepository, personRepository);
            var churchEmailTemplatesRepository = new ChurchEmailTemplatesRepository();
            var emailContentRepository = new EmailContentRepository();
            var emailContentService = new EmailContentService(emailContentRepository);
            var emailService = new EmailService(usernamePasswordRepository, personRepository, groupRepository, emailSender, emailContentService, churchEmailTemplatesRepository, permissionRepository);

            IEventService eventService = new EventService(eventRepository, emailService, new BirthdayAndAniversaryRepository());
            var eventDto = eventService.GetEvent(1);
            Assert.That(eventDto, Is.EqualTo(expectedEventDto));
        }
Ejemplo n.º 2
0
        public void CanCreateANewEvent()
        {
            var eventTypeRepository = MockRepository.GenerateStub<IEventRepository>();

            var permissionRepository = new PermissionRepository();
            var personRepository = new PersonRepository(permissionRepository, new ChurchRepository());
            var usernamePasswordRepository = new UsernamePasswordRepository(permissionRepository);
            var groupRepository = new GroupRepository();
            var messageRepository = new MessageRepository();
            var messageRecepientRepository = new MessageRecepientRepository();
            var messageAttachmentRepository = new MessageAttachmentRepository();
            var emailSender = new EmailSender(messageRepository, messageRecepientRepository, messageAttachmentRepository, personRepository);
            var churchEmailTemplatesRepository = new ChurchEmailTemplatesRepository();
            var emailContentRepository = new EmailContentRepository();
            var emailContentService = new EmailContentService(emailContentRepository);
            var emailService = new EmailService(usernamePasswordRepository, personRepository, groupRepository, emailSender, emailContentService, churchEmailTemplatesRepository, permissionRepository);
            IEventService eventTypeService = new EventService(eventTypeRepository, emailService, new BirthdayAndAniversaryRepository());
            var newEvent = new EventDto();
            eventTypeRepository
                .Expect(e => e.SaveItem(newEvent))
                .Return(1);
            var result = eventTypeService.CreateEvent(newEvent);

            Assert.That(result, Is.EqualTo(1));
        }
Ejemplo n.º 3
0
        public AjaxController()
        {
            var messageRepository = new MessageRepository();
            var permissionRepository = new PermissionRepository();
            var churchRepository = new ChurchRepository();
            var personRepository = new PersonRepository(permissionRepository, churchRepository);
            var uploadPhotoRepository = new PhotoRepository();
            _familyRepository = new FamilyRepository(uploadPhotoRepository);
            _usernamePasswordRepository = new UsernamePasswordRepository(permissionRepository);
            var personGroupRepository = new PersonGroupRepository(personRepository);
            _personGroupRepository = personGroupRepository;
            var groupRepository = new GroupRepository();
            var emailSender = new EmailSender(messageRepository, new MessageRecepientRepository(), new MessageAttachmentRepository(), personRepository);
            var emailContentService = new EmailContentService(new EmailContentRepository());
            var churchEmailTemplateRepository = new ChurchEmailTemplatesRepository();
            _emailService = new EmailService(
                _usernamePasswordRepository,
                personRepository,
                groupRepository,
                emailSender,
                emailContentService,
                churchEmailTemplateRepository,
                permissionRepository
                );

            _passwordService = new PasswordService(personRepository, churchRepository, _usernamePasswordRepository, _emailService);

            _personService = new PersonService(
                personRepository,
                _personGroupRepository,
                permissionRepository,
                new PersonRoleRepository(),
                new PersonOptionalFieldRepository(),
                new RelationshipRepository(personRepository),
                new ChurchMatcherRepository(),
                groupRepository,
                _familyRepository,
                _emailService,
                new AddressRepository(),
                uploadPhotoRepository
                );

            _groupEventRepository = new GroupEventRepository(personRepository);
            _systemAdministratorService  = new SystemAdministratorService(churchRepository, permissionRepository);
            _personGroupService = new PersonGroupService(_personGroupRepository);
            _messageRecepientRepository = new MessageRecepientRepository();
            var httpPostService = new HttpPostService();
            _smsSender = new SmsSender(messageRepository, new MessageRecepientRepository(), personRepository, httpPostService);
            _churchEventsReporitory = new ChurchEventsRepository();
            _messageService = new MessageService(_messageRecepientRepository);
            var birthdayRepository = new BirthdayAndAniversaryRepository();
            var usernamePasswordRepository = new UsernamePasswordRepository(permissionRepository);
            var churchEmailTemplatesRepository = new ChurchEmailTemplatesRepository();
            var emailService = new EmailService(usernamePasswordRepository, personRepository, groupRepository, emailSender, emailContentService, churchEmailTemplatesRepository, permissionRepository);
            var eventRepository = new EventRepository(birthdayRepository);
            _eventService = new EventService(eventRepository, emailService, birthdayRepository);
            _childReportsService = new ChildReportsService(new ChildrenReportsRepository(), _emailService);
            _reminderService = new ReminderService(new ReminderRepository());
        }
 public GroupEventsController()
 {
     var birthdayRepository = new BirthdayAndAniversaryRepository();
     var permissionRepository = new PermissionRepository();
     var personRepository = new PersonRepository(permissionRepository, new ChurchRepository());
     var usernamePasswordRepository = new UsernamePasswordRepository(permissionRepository);
     var groupRepository = new GroupRepository();
     var messageRepository = new MessageRepository();
     var messageRecepientRepository = new MessageRecepientRepository();
     var messageAttachmentRepository = new MessageAttachmentRepository();
     var emailSender = new EmailSender(messageRepository, messageRecepientRepository, messageAttachmentRepository, personRepository);
     var churchEmailTemplatesRepository = new ChurchEmailTemplatesRepository();
     var emailContentRepository = new EmailContentRepository();
     var emailContentService = new EmailContentService(emailContentRepository);
     var emailService = new EmailService(usernamePasswordRepository, personRepository, groupRepository, emailSender, emailContentService, churchEmailTemplatesRepository, permissionRepository);
     var eventRepository = new EventRepository(birthdayRepository);
     _eventService = new EventService(eventRepository, emailService, birthdayRepository);
 }
Ejemplo n.º 5
0
 public EmailController()
 {
     var permissionRepository = new PermissionRepository();
     var personRepository = new PersonRepository(permissionRepository, new ChurchRepository());
     var usernamePasswordRepository = new UsernamePasswordRepository(permissionRepository);
     var groupRepository = new GroupRepository();
     _messageRecepientRepository = new MessageRecepientRepository();
     var emailSender = new EmailSender(new MessageRepository(), _messageRecepientRepository, new MessageAttachmentRepository(), personRepository);
     var emailContentService = new EmailContentService(new EmailContentRepository());
     var churchEmailTemplateRepository = new ChurchEmailTemplatesRepository();
     _emailService = new EmailService(
         usernamePasswordRepository,
         personRepository,
         groupRepository,
         emailSender,
         emailContentService,
         churchEmailTemplateRepository,
         permissionRepository
         );
 }
Ejemplo n.º 6
0
        public HomeController()
        {
            var permissionRepository = new PermissionRepository();
            var churchRepository = new ChurchRepository();
            _personRepository = new PersonRepository(permissionRepository, churchRepository); var birthdayRepository = new BirthdayAndAniversaryRepository();
            var personRepository = new PersonRepository(permissionRepository, new ChurchRepository());
            var usernamePasswordRepository = new UsernamePasswordRepository(permissionRepository);
            var groupRepository = new GroupRepository();
            var messageRepository = new MessageRepository();
            var messageRecepientRepository = new MessageRecepientRepository();
            var messageAttachmentRepository = new MessageAttachmentRepository();
            var emailSender = new EmailSender(messageRepository, messageRecepientRepository, messageAttachmentRepository, personRepository);
            var churchEmailTemplatesRepository = new ChurchEmailTemplatesRepository();
            var emailContentRepository = new EmailContentRepository();
            var emailContentService = new EmailContentService(emailContentRepository);
            _emailService = new EmailService(usernamePasswordRepository, personRepository, groupRepository, emailSender, emailContentService, churchEmailTemplatesRepository, permissionRepository);
            var eventRepository = new EventRepository(birthdayRepository);
            _eventService = new EventService(eventRepository, _emailService, birthdayRepository);
            _personGroupRepository = new PersonGroupRepository(_personRepository);
            _usernamePasswordRepository = new UsernamePasswordRepository(permissionRepository);

            _photoRepository = new PhotoRepository();
            _photoServices = new PhotoServices();
            _personService = new PersonService(
                _personRepository,
                new PersonGroupRepository(_personRepository),
                permissionRepository,
                new PersonRoleRepository(),
                new PersonOptionalFieldRepository(),
                new RelationshipRepository(_personRepository),
                new ChurchMatcherRepository(),
                new GroupRepository(),
                new FamilyRepository(_photoRepository),
                _emailService,
                new AddressRepository(),
                _photoRepository
                );
        }
        public TabletClientItemsController()
        {
            var permissionRepository = new PermissionRepository();
            var churchRepository = new ChurchRepository();
            _personRepository = new PersonRepository(permissionRepository, churchRepository);
            var personGroupRepository = new PersonGroupRepository(_personRepository);
            var relationshipRepository = new RelationshipRepository(_personRepository);
            var usernamePasswordRepository = new UsernamePasswordRepository(permissionRepository);
            var emailSender = new EmailSender(new MessageRepository(), new MessageRecepientRepository(), new MessageAttachmentRepository(), _personRepository);
            var groupRepository = new GroupRepository();
            var emailContentService = new EmailContentService(new EmailContentRepository());
            var churchEmailTemplateRepository = new ChurchEmailTemplatesRepository();
            var emailService = new EmailService(
                usernamePasswordRepository,
                _personRepository,
                groupRepository,
                emailSender,
                emailContentService,
                churchEmailTemplateRepository,
                permissionRepository
                );

            var uploadPhotoRepository = new PhotoRepository();

            _personService = new PersonService(_personRepository,
                personGroupRepository,
                permissionRepository,
                new PersonRoleRepository(),
                new PersonOptionalFieldRepository(),
                relationshipRepository,
                new ChurchMatcherRepository(),
                new GroupRepository(),
                new FamilyRepository(uploadPhotoRepository),
                emailService,
                new AddressRepository(),
                uploadPhotoRepository);
        }