Ejemplo n.º 1
0
        public static WorkgroupVendorViewModel Create(IRepositoryWithTypedId<Vendor, string> vendorRepository, WorkgroupVendor workgroupVendor = null, Vendor vendor = null, VendorAddress vendorAddress = null, bool? newVendor = null)
        {
            Check.Require(vendorRepository != null, "Repository must be supplied");

            var addresses = vendor != null ? new MultiSelectList(vendor.VendorAddresses.Select(a => new { TypeCode = a.TypeCode, Name = string.Format("{0} ({1}, {2}, {3} {4})", a.Name, a.Line1, a.City, a.State, a.Zip) }).ToList(), "TypeCode", "Name") : new MultiSelectList(new List<VendorAddress>(), "TypeCode", "Name");

            var viewModel = new WorkgroupVendorViewModel
                                {
                                    WorkgroupVendor = workgroupVendor ?? new WorkgroupVendor(),
                                    Vendor = vendor,
                                    VendorAddress = vendorAddress,
                                    //Vendors = vendorRepository.Queryable.OrderBy(a => a.Name).ToList(),
                                    VendorAddresses = addresses,
                                    NewVendor = newVendor
                                };
            if(viewModel.WorkgroupVendor.VendorId != null && string.IsNullOrWhiteSpace(viewModel.WorkgroupVendor.Name))
            {
                var locVendor = vendorRepository.Queryable.First(a => a.Id == viewModel.WorkgroupVendor.VendorId);
                if(locVendor != null)
                {
                    viewModel.WorkgroupVendor.Name = locVendor.Name;
                }
            }
            return viewModel;
        }
Ejemplo n.º 2
0
 public DevStudentService(IRepositoryWithTypedId<Student, Guid> studentRepository, IRepository<Ceremony> ceremonyRepository, IRepository<Registration> registrationRepository, IRepositoryWithTypedId<MajorCode, string> majorRepository)
 {
     _studentRepository = studentRepository;
     _ceremonyRepository = ceremonyRepository;
     _registrationRepository = registrationRepository;
     _majorRepository = majorRepository;
 }
Ejemplo n.º 3
0
 public PublicController(IRepository<InformationRequest> informationRequestRepository, IRepositoryWithTypedId<SeminarRole, string> seminarRoleRepository, IRepository<CaseStudy> caseStudyRepository, INotificationService notificationService)
 {
     _informationRequestRepository = informationRequestRepository;
     _seminarRoleRepository = seminarRoleRepository;
     _caseStudyRepository = caseStudyRepository;
     _notificationService = notificationService;
 }
Ejemplo n.º 4
0
 //, INotificationSender notificationSender)
 //private readonly INotificationSender _notificationSender;
 public SystemController(IIndexService indexService, IRepositoryFactory repositoryFactory, IRepositoryWithTypedId<EmailQueue, Guid> emailQueueRepository)
 {
     _indexService = indexService;
     _repositoryFactory = repositoryFactory;
     _emailQueueRepository = emailQueueRepository;
     //_notificationSender = notificationSender;
 }
        public NotificationServiceTests()
        {
            EmailRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<EmailQueue, Guid>>();
            EmailPreferenceRepository = MockRepository.GenerateStub < IRepositoryWithTypedId<EmailPreferences, string>>();
            UserIdentity = MockRepository.GenerateStub<IUserIdentity>();
            UserRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<User, string>>();
            OrderStatusCodeRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<OrderStatusCode, string>>();
            ServerLink = MockRepository.GenerateStub<IServerLink>();
            QueryRepositoryFactory = MockRepository.GenerateStub<IQueryRepositoryFactory>();
            RepositoryFactory = MockRepository.GenerateStub<IRepositoryFactory>();
            RepositoryFactory.OrganizationRepository =
                MockRepository.GenerateStub<IRepositoryWithTypedId<Organization, string>>();

            AdminWorkgroupRepository = MockRepository.GenerateStub<IRepository<AdminWorkgroup>>();
            QueryRepositoryFactory.AdminWorkgroupRepository = AdminWorkgroupRepository;
            WorkgroupRepository = MockRepository.GenerateStub<IRepository<Workgroup>>();
            RepositoryFactory.WorkgroupRepository = WorkgroupRepository;

            NotificationService = new NotificationService(EmailRepository, EmailPreferenceRepository, UserRepository, OrderStatusCodeRepository, UserIdentity, ServerLink, QueryRepositoryFactory, RepositoryFactory);

            ServerLink.Expect(a => a.Address).Return("FakeHost").Repeat.Any();
            ApprovalRepository = MockRepository.GenerateStub<IRepository<Approval>>();

            SetupOrderStatusCodes();
        }
Ejemplo n.º 6
0
 public EmailQueueController(IRepository<EmailQueue> emailQueueRepository, IRepositoryWithTypedId<Student, Guid> studentRepository , ICeremonyService ceremonyService, ILetterGenerator letterGenerator)
 {
     _emailQueueRepository = emailQueueRepository;
     _studentRepository = studentRepository;
     _ceremonyService = ceremonyService;
     _letterGenerator = letterGenerator;
 }
Ejemplo n.º 7
0
        public WorkgroupServiceTests()
        {
            AutomapperConfig.Configure();
            VendorRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<Vendor, string>>();
            VendorAddressRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<VendorAddress, Guid>>();
            UserRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<User, string>>();
            EmailPreferencesRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<EmailPreferences, string>>();
            WorkgroupPermissionRepository = MockRepository.GenerateStub<IRepository<WorkgroupPermission>>();
            WorkgroupRepository = MockRepository.GenerateStub<IRepository<Workgroup>>();
            OrganizationRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<Organization, string>>();
            SearchService = MockRepository.GenerateStub<IDirectorySearchService>();
            RepositoryFactory = MockRepository.GenerateStub<IRepositoryFactory>();
            RepositoryFactory.RoleRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<Role, string>>();
            RepositoryFactory.WorkgroupPermissionRepository = WorkgroupPermissionRepository;
            RepositoryFactory.AccountRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<Account, string>>();
            QueryRepositoryFactory = MockRepository.GenerateStub<IQueryRepositoryFactory>();
            UserIdentity = MockRepository.GenerateStub<IUserIdentity>();

            QueryRepositoryFactory.RelatatedWorkgroupsRepository =
                MockRepository.GenerateStub<IRepository<RelatedWorkgroups>>();

            WorkgroupService = new WorkgroupService(VendorRepository,
                VendorAddressRepository,
                UserRepository,
                EmailPreferencesRepository,
                WorkgroupPermissionRepository,
                WorkgroupRepository,
                OrganizationRepository,
                SearchService,
                RepositoryFactory, QueryRepositoryFactory, UserIdentity);
        }
Ejemplo n.º 8
0
        public static void FakeCollege(int count, IRepositoryWithTypedId<College, string> repository, List<College> specificColleges)
        {
            var colleges = new List<College>();
            var specificTransactionsCount = 0;
            if (specificColleges != null)
            {
                specificTransactionsCount = specificColleges.Count;
                for (int i = 0; i < specificTransactionsCount; i++)
                {
                    colleges.Add(specificColleges[i]);
                }
            }

            for (int i = 0; i < count; i++)
            {
                colleges.Add(CreateValidEntities.College(i + specificTransactionsCount + 1));
            }

            var totalCount = colleges.Count;
            for (int i = 0; i < totalCount; i++)
            {
                colleges[i].SetIdTo((i + 1).ToString());
                int i1 = i;
                repository
                    .Expect(a => a.GetNullableById((i1 + 1).ToString()))
                    .Return(colleges[i])
                    .Repeat
                    .Any();
            }
            repository.Expect(a => a.GetNullableById((totalCount + 1).ToString())).Return(null).Repeat.Any();
            repository.Expect(a => a.Queryable).Return(colleges.AsQueryable()).Repeat.Any();
            repository.Expect(a => a.GetAll()).Return(colleges).Repeat.Any();
        }
Ejemplo n.º 9
0
 public CaseStudyController(IRepository<CaseStudy> casestudyRepository, IRepository<Seminar> seminarRepository, IRepositoryWithTypedId<User, Guid> userRepository, IRepository<SeminarPerson> seminarPersonRepository, IPersonService personService)
 {
     _casestudyRepository = casestudyRepository;
     _seminarRepository = seminarRepository;
     _userRepository = userRepository;
     _seminarPersonRepository = seminarPersonRepository;
     _personService = personService;
 }
Ejemplo n.º 10
0
        public static AddMajorCodeViewModel Create(IRepositoryWithTypedId<MajorCode, string> majorRepository, MajorCode majorCode)
        {
            Check.Require(majorRepository != null, "Repository is required.");

            var viewModel = new AddMajorCodeViewModel() {MajorCodes = majorRepository.GetAll("Id", true), MajorCode = majorCode, NewMajor = false};

            return viewModel;
        }
 public DepartmentalAdminRequestController(IRepositoryWithTypedId<DepartmentalAdminRequest, string> departmentalAdminRequestRepository, IRepositoryFactory repositoryFactory, IQueryRepositoryFactory queryRepositoryFactory, IDirectorySearchService directorySearchService, IUserIdentity userIdentity)
 {
     _departmentalAdminRequestRepository = departmentalAdminRequestRepository;
     _repositoryFactory = repositoryFactory;
     _queryRepositoryFactory = queryRepositoryFactory;
     _directorySearchService = directorySearchService;
     _userIdentity = userIdentity;
 }
Ejemplo n.º 12
0
        public static MajorCodeViewModel Create(IRepositoryWithTypedId<MajorCode, string> majorRepository, IRepositoryWithTypedId<College, string> collegeRepository)
        {
            Check.Require(majorRepository != null, "majorRepository is required.");
            Check.Require(collegeRepository != null, "collegeRepository is required.");

            var viewModel = new MajorCodeViewModel() {MajorCodes = majorRepository.GetAll("Id", true), Colleges = collegeRepository.GetAll()};

            return viewModel;
        }
Ejemplo n.º 13
0
 public CeremonyController(IRepositoryWithTypedId<TermCode, string> termRepository, IRepositoryWithTypedId<vTermCode, string> vTermRepository, IRepositoryWithTypedId<College, string> collegeRepository, IMajorService majorService, ICeremonyService ceremonyService, IUserService userService)
 {
     _termRepository = termRepository;
     _vTermRepository = vTermRepository;
     _collegeRepository = collegeRepository;
     _majorService = majorService;
     _ceremonyService = ceremonyService;
     _userService = userService;
 }
Ejemplo n.º 14
0
 public NamSearchController(IRepositoryWithTypedId<Vlan, int> vlanRepository, IRepositoryWithTypedId<DataNam, int> dataNamRepository,
     IRepositoryWithTypedId<Building, int> buildingRepository, IRepositoryWithTypedId<Department, string> departmentRepository
     )
 {
     _vlanRepository = vlanRepository;
     _dataNamRepository = dataNamRepository;
     _buildingRepository = buildingRepository;
     _departmentRepository = departmentRepository;
 }
        public InformationRequestController(IRepository<InformationRequest> informationrequestRepository, IRepository<InformationRequestNote> informationRequestNoteRepository, IRepositoryWithTypedId<AddressType, char> addressTypeRepository, IFirmService firmService, IRepository<User> userRepository, IRepository<Person> personRepository )
        {
            _informationrequestRepository = informationrequestRepository;
            _informationRequestNoteRepository = informationRequestNoteRepository;
            _addressTypeRepository = addressTypeRepository;
            _firmService = firmService;
            _userRepository = userRepository;
            _personRepository = personRepository;

            _membershipService = new AccountMembershipService();
        }
Ejemplo n.º 16
0
 /* strings to be used in the messages */
 //private const string ApprovalMessage = "Order request {0} for {1} has been approved by {2} at {3} review.";
 //private const string CancellationMessage = "Order request {0} for {1} has been cancelled by {2} at {3} review with the following comment \"{4}\".";
 //private const string UpdateInKualiMessage = "Order request {0} for {1} has been updated in Kuali to {2}.";
 //private const string ChangeMessage = "Order request {0} for {1} has been changed by {2}.";
 //private const string SubmissionMessage = "Order request {0} for {1} has been submitted.";
 //private const string ArrivalMessage = "Order request {0} for {1} has arrived at your level ({2}) for review from {3}{4}.";
 //private const string CompleteMessage = "Order request {0} for {1} has been completed by {2}.  Order will be completed as a {3}.";
 //private const string ReceiveMessage = "Order request {0} for {1} has {2} item(s) received.";
 //private const string RerouteMessage = "Order request {0} for {1} has been rerouted to you.";
 //private const string AddAttachmentMessage = "Order request {0} for {1} has a new attachment added by {2}";
 //private const string AddNoteMessage = "Order request {0} for {1} has a new note added by {2}";
 public NotificationService(IRepositoryWithTypedId<EmailQueue, Guid> emailRepository, IRepositoryWithTypedId<EmailPreferences, string> emailPreferenceRepository, IRepositoryWithTypedId<User, string> userRepository, IRepositoryWithTypedId<OrderStatusCode, string> orderStatusCodeRepository, IUserIdentity userIdentity, IServerLink serverLink, IQueryRepositoryFactory queryRepositoryFactory, IRepositoryFactory repositoryFactory )
 {
     _emailRepository = emailRepository;
     _emailPreferenceRepository = emailPreferenceRepository;
     _userRepository = userRepository;
     _orderStatusCodeRepository = orderStatusCodeRepository;
     _userIdentity = userIdentity;
     _serverLink = serverLink;
     //_serverLink = "prepurchasing.ucdavis.edu";
     _queryRepositoryFactory = queryRepositoryFactory;
     _repositoryFactory = repositoryFactory;
 }
Ejemplo n.º 17
0
 public AttendeeController(IRepository<Seminar> seminarRespository, IRepositoryWithTypedId<User, Guid> userRepository, IRepository<SeminarPerson> seminarPersonRepository
                         , IRepository<Person> personRepository, IRepository<Firm> firmRepository
                         , IPersonService personService, IRegistrationService registrationService, IFirmService firmService, Agribusiness.Web.Services.INotificationService notificationService)
 {
     _seminarRespository = seminarRespository;
     _userRepository = userRepository;
     _seminarPersonRepository = seminarPersonRepository;
     _personRepository = personRepository;
     _firmRepository = firmRepository;
     _personService = personService;
     _registrationService = registrationService;
     _firmService = firmService;
     _notificationService = notificationService;
 }
Ejemplo n.º 18
0
        public PersonService(IRepository<Firm> firmRepository, IRepository<Person> personRepository, IRepository<SeminarPerson> seminarPersonRepository, IRepository<Seminar> seminarRepository, IRepositoryWithTypedId<User, Guid> userRepository, IFirmService firmService, IRepositoryWithTypedId<AddressType, char> addressTypeRepository, IRepositoryWithTypedId<ContactType, char> contactTypeRepository, IRepository<Commodity> commodityRepository )
        {
            _firmRepository = firmRepository;
            _personRepository = personRepository;
            _seminarPersonRepository = seminarPersonRepository;
            _seminarRepository = seminarRepository;
            _userRepository = userRepository;
            _firmService = firmService;
            _addressTypeRepository = addressTypeRepository;
            _contactTypeRepository = contactTypeRepository;
            _commodityRepository = commodityRepository;

            _membershipService = new AccountMembershipService();
        }
Ejemplo n.º 19
0
 public AdminController(IRepositoryWithTypedId<Student, Guid> studentRepository, IRepositoryWithTypedId<MajorCode, string> majorRepository, IStudentService studentService, IEmailService emailService, IMajorService majorService, ICeremonyService ceremonyService, IRegistrationService registrationService, IRegistrationPopulator registrationPopulator, IRepository<Registration> registrationRepository, IErrorService errorService, IReportService reportService)
 {
     if (emailService == null) throw new ArgumentNullException("emailService");
     _studentRepository = studentRepository;
     _majorRepository = majorRepository;
     _studentService = studentService;
     _emailService = emailService;
     _majorService = majorService;
     _ceremonyService = ceremonyService;
     _registrationService = registrationService;
     _registrationPopulator = registrationPopulator;
     _registrationRepository = registrationRepository;
     _errorService = errorService;
     _reportService = reportService;
 }
Ejemplo n.º 20
0
        public FileService(IRepositoryWithTypedId<Attachment, Guid> attachmentRepository)
        {
            _attachmentRepository = attachmentRepository;

            var storageConnectionString =
                string.Format("DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}",
                              CloudConfigurationManager.GetSetting("AzureStorageAccountName"),
                              CloudConfigurationManager.GetSetting("AzureStorageKey"));

            var storageAccount = CloudStorageAccount.Parse(storageConnectionString);

            var blobClient = storageAccount.CreateCloudBlobClient();

            _container = blobClient.GetContainerReference("oppattachments");
            _container.CreateIfNotExists();
            _container.SetPermissions(new BlobContainerPermissions {PublicAccess = BlobContainerPublicAccessType.Off});
        }
Ejemplo n.º 21
0
        public static HomeViewModel Create(IRepositoryWithTypedId<Site, string> siteRepository, Site site)
        {
            var viewModel = new HomeViewModel()
                                {
                                    Site = site
                                };

            if (site == null)
            {
                viewModel.Sites = siteRepository.Queryable.Where(a => a.IsActive).ToList();
            }
            else
            {
                // load the current seminar
                viewModel.Seminar = SiteService.GetLatestSeminar(site.Id);
            }

            return viewModel;
        }
Ejemplo n.º 22
0
        public PersonController(IRepository<Person> personRepository, IRepositoryWithTypedId<User, Guid> userRepository, IRepositoryWithTypedId<SeminarRole, string> seminarRoleRepository
            , IRepository<SeminarPerson> seminarPersonRepository, IRepository<Seminar> seminarRepository, IRepositoryWithTypedId<Agribusiness.Core.Domain.Membership, Guid>  membershipRepository
            , IPictureService pictureService, IPersonService personService, IFirmService firmService, IRegistrationService registrationService
            , IvCardService vCardService,IEventService eventService, IRepositoryFactory repositoryFactory)
        {
            _personRepository = personRepository;
            _userRepository = userRepository;
            _seminarRoleRepository = seminarRoleRepository;
            _seminarPersonRepository = seminarPersonRepository;
            _seminarRepository = seminarRepository;
            _membershipRepository = membershipRepository;
            _pictureService = pictureService;
            _personService = personService;
            _firmService = firmService;
            _registrationService = registrationService;
            _vCardService = vCardService;
            _eventService = eventService;
            _repositoryFactory = repositoryFactory;

            _membershipService = new AccountMembershipService();
        }
Ejemplo n.º 23
0
 public WorkgroupService(IRepositoryWithTypedId<Vendor, string> vendorRepository, 
     IRepositoryWithTypedId<VendorAddress, Guid> vendorAddressRepository, 
     IRepositoryWithTypedId<User, string> userRepository,
     IRepositoryWithTypedId<EmailPreferences, string> emailPreferencesRepository,
     IRepository<WorkgroupPermission> workgroupPermissionRepository,
     IRepository<Workgroup> workgroupRepository,
     IRepositoryWithTypedId<Organization, string> organizationRepository,
     IDirectorySearchService searchService, IRepositoryFactory repositoryFactory, IQueryRepositoryFactory queryRepositoryFactory, IUserIdentity userIdentity)
 {
     _vendorRepository = vendorRepository;
     _vendorAddressRepository = vendorAddressRepository;
     _userRepository = userRepository;
     _emailPreferencesRepository = emailPreferencesRepository;
     _workgroupPermissionRepository = workgroupPermissionRepository;
     _workgroupRepository = workgroupRepository;
     _organizationRepository = organizationRepository;
     _searchService = searchService;
     _repositoryFactory = repositoryFactory;
     _queryRepositoryFactory = queryRepositoryFactory;
     _userIdentity = userIdentity;
 }
Ejemplo n.º 24
0
 public StudentController(IStudentService studentService, 
     IEmailService emailService,
     IRepositoryWithTypedId<Student, Guid> studentRepository,
     IRepository<Ceremony> ceremonyRepository,
     IRepository<Registration> registrationRepository,
     IErrorService errorService,
     ICeremonyService ceremonyService,
     IReportService reportService,
     IRepository<RegistrationPetition> registrationPetitionRepository,
     IRepository<RegistrationParticipation> participationRepository, IRegistrationPopulator registrationPopulator)
 {
     _studentRepository = studentRepository;
     _ceremonyRepository = ceremonyRepository;
     _registrationRepository = registrationRepository;
     _errorService = errorService;
     _ceremonyService = ceremonyService;
     _reportService = reportService;
     _registrationPetitionRepository = registrationPetitionRepository;
     _participationRepository = participationRepository;
     _registrationPopulator = registrationPopulator;
     _studentService = studentService;
     _emailService = emailService;
 }
Ejemplo n.º 25
0
 public MomoLandingViewComponent(IRepositoryWithTypedId <PaymentProvider, string> paymentProviderRepository)
 {
     _paymentProviderRepository = paymentProviderRepository;
 }
Ejemplo n.º 26
0
 public FakeVendorAddresses(int count, IRepositoryWithTypedId <VendorAddress, Guid> repository, List <VendorAddress> specificRecords, bool bypassSetIdTo)
 {
     Records(count, repository, specificRecords, bypassSetIdTo);
 }
Ejemplo n.º 27
0
 public FakeAccounts(int count, IRepositoryWithTypedId <Account, string> repository)
 {
     Records(count, repository, false);
 }
Ejemplo n.º 28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WorkgroupAccountRepositoryTests"/> class.
 /// </summary>
 public WorkgroupAccountRepositoryTests()
 {
     WorkgroupAccountRepository = new Repository <WorkgroupAccount>();
     AccountRepository          = new RepositoryWithTypedId <Account, string>();
     UserRepository             = new RepositoryWithTypedId <User, string>();
 }
Ejemplo n.º 29
0
 public FakeCommentHistory(int count, IRepositoryWithTypedId <CommentHistory, Guid> repository, List <CommentHistory> specificRecords, bool bypassSetIdTo)
 {
     Records(count, repository, specificRecords, bypassSetIdTo);
 }
Ejemplo n.º 30
0
 public FakeAttachments(int count, IRepositoryWithTypedId <Attachment, Guid> repository, List <Attachment> specificRecords, bool bypassSetIdTo, bool useSpecificGuids = false)
 {
     Records(count, repository, specificRecords, bypassSetIdTo, useSpecificGuids);
 }
Ejemplo n.º 31
0
 public CountryApiController(IRepositoryWithTypedId <Country, string> countryRepository)
 {
     _countryRepository = countryRepository;
 }
Ejemplo n.º 32
0
 public StateOrProvinceApiController(IRepository <StateOrProvince> stateOrProvinceRepository, IRepositoryWithTypedId <Country, string> countryRepository)
 {
     _stateOrProvinceRepository = stateOrProvinceRepository;
     _countryRepository         = countryRepository;
 }
Ejemplo n.º 33
0
 public static void FakeMajors(int count, IRepositoryWithTypedId<MajorCode, string> majorRepository)
 {
     var majorCodes = new List<MajorCode>();
     FakeMajors(count, majorRepository, majorCodes);
 }
Ejemplo n.º 34
0
 public FakeEmailPreferences(int count, IRepositoryWithTypedId <EmailPreferences, string> repository)
 {
     Records(count, repository, false);
 }
Ejemplo n.º 35
0
 public FakeEmailPreferences(int count, IRepositoryWithTypedId <EmailPreferences, string> repository, List <EmailPreferences> specificRecords, bool bypassSetIdTo)
 {
     Records(count, repository, specificRecords, bypassSetIdTo);
 }
Ejemplo n.º 36
0
 public AppSettingApiController(IRepositoryWithTypedId <AppSetting, string> appSettingRepository, IConfiguration configuration)
 {
     _appSettingRepository = appSettingRepository;
     _configurationRoot    = (IConfigurationRoot)configuration;
 }
Ejemplo n.º 37
0
 public FakeSubAccounts(int count, IRepositoryWithTypedId <SubAccount, Guid> repository)
 {
     Records(count, repository, false);
 }
Ejemplo n.º 38
0
 public FakeSubAccounts(int count, IRepositoryWithTypedId <SubAccount, Guid> repository, List <SubAccount> specificRecords, bool bypassSetIdTo)
 {
     Records(count, repository, specificRecords, bypassSetIdTo);
 }
Ejemplo n.º 39
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BuildingRepositoryTests"/> class.
 /// </summary>
 public BuildingRepositoryTests()
 {
     BuildingRepository = new RepositoryWithTypedId <Building, string>();
 }
Ejemplo n.º 40
0
 /// <summary>
 /// Fakes the student. Note: Using more than 20 will not be reliable
 /// because the Guids will be random
 /// </summary>
 /// <param name="count">The count.</param>
 /// <param name="studentRepository">The student repository.</param>
 /// <param name="studentRepository2">The student repository2.</param>
 public static void FakeStudent(int count, IRepositoryWithTypedId<Student, Guid> studentRepository, IRepository<Student> studentRepository2)
 {
     var students = new List<Student>();
     FakeStudent(count, studentRepository, students, studentRepository2);
 }
Ejemplo n.º 41
0
 public FakeAttachments(int count, IRepositoryWithTypedId <Attachment, Guid> repository)
 {
     Records(count, repository, false);
 }
Ejemplo n.º 42
0
 public static void FakeCollege(int count, IRepositoryWithTypedId<College, string> repository)
 {
     var colleges = new List<College>();
     FakeCollege(count, repository, colleges);
 }
Ejemplo n.º 43
0
 public ShippingProviderApiController(IRepositoryWithTypedId <ShippingProvider, string> shippingProviderRepositor)
 {
     _shippingProviderRepositor = shippingProviderRepositor;
 }
Ejemplo n.º 44
0
 public FakeVendors(int count, IRepositoryWithTypedId <Vendor, string> repository)
 {
     Records(count, repository, false);
 }
Ejemplo n.º 45
0
 public FakeCommentHistory(int count, IRepositoryWithTypedId <CommentHistory, Guid> repository)
 {
     Records(count, repository, false);
 }
 public WidgetInstanceApiController(IRepository <WidgetInstance> widgetInstanceRepository, IRepositoryWithTypedId <Widget, string> widgetRespository)
 {
     _widgetInstanceRepository = widgetInstanceRepository;
     _widgetRespository        = widgetRespository;
 }
Ejemplo n.º 47
0
 public NganLuongApiController(IRepositoryWithTypedId <PaymentProvider, string> paymentProviderRepository)
 {
     _paymentProviderRepository = paymentProviderRepository;
 }
Ejemplo n.º 48
0
 public FakeVendors(int count, IRepositoryWithTypedId <Vendor, string> repository, List <Vendor> specificRecords, bool bypassSetIdTo)
 {
     Records(count, repository, specificRecords, bypassSetIdTo);
 }
Ejemplo n.º 49
0
 public FakeVendorAddresses(int count, IRepositoryWithTypedId <VendorAddress, Guid> repository)
 {
     Records(count, repository, false);
 }
Ejemplo n.º 50
0
 public UserAddressController(IRepository <UserAddress> userAddressRepository, IRepositoryWithTypedId <Country, string> countryRepository, IRepository <StateOrProvince> stateOrProvinceRepository,
                              IRepository <District> districtRepository, IRepository <User> userRepository, IWorkContext workContext)
 {
     _userAddressRepository     = userAddressRepository;
     _countryRepository         = countryRepository;
     _stateOrProvinceRepository = stateOrProvinceRepository;
     _districtRepository        = districtRepository;
     _userRepository            = userRepository;
     _workContext = workContext;
 }
Ejemplo n.º 51
0
 public AutoApprovalController(IRepository <AutoApproval> autoApprovalRepository, IRepositoryWithTypedId <User, string> userRepository)
 {
     _autoApprovalRepository = autoApprovalRepository;
     _userRepository         = userRepository;
 }
Ejemplo n.º 52
0
 public FakeAccounts(int count, IRepositoryWithTypedId <Account, string> repository, List <Account> specificRecords, bool bypassSetIdTo)
 {
     Records(count, repository, specificRecords, bypassSetIdTo);
 }
Ejemplo n.º 53
0
        public static void FakeMajors(int count, IRepositoryWithTypedId<MajorCode, string> majorRepository, List<MajorCode> specificMajorCodes)
        {
            var majorCodes = new List<MajorCode>();
            var specificMajorCodesCount = 0;
            if (specificMajorCodes != null)
            {
                specificMajorCodesCount = specificMajorCodes.Count;
                for (int i = 0; i < specificMajorCodesCount; i++)
                {
                    majorCodes.Add(specificMajorCodes[i]);
                }
            }

            for (int i = 0; i < count; i++)
            {
                majorCodes.Add(CreateValidEntities.MajorCode(i + specificMajorCodesCount + 1));
            }

            var totalCount = majorCodes.Count;
            for (int i = 0; i < totalCount; i++)
            {
                majorCodes[i].SetIdTo((i + 1).ToString());
                int i1 = i;
                majorRepository
                    .Expect(a => a.GetNullableById((i1 + 1).ToString()))
                    .Return(majorCodes[i])
                    .Repeat
                    .Any();
            }
            majorRepository.Expect(a => a.GetNullableById((totalCount + 1).ToString())).Return(null).Repeat.Any();
            majorRepository.Expect(a => a.Queryable).Return(majorCodes.AsQueryable()).Repeat.Any();
            majorRepository.Expect(a => a.GetAll()).Return(majorCodes).Repeat.Any();
        }
 public StripeLandingViewComponent(ICartService cartService, IWorkContext workContext, IRepositoryWithTypedId <PaymentProvider, string> paymentProviderRepository)
 {
     _cartService = cartService;
     _workContext = workContext;
     _paymentProviderRepository = paymentProviderRepository;
 }
Ejemplo n.º 55
0
        /// <summary>
        /// Fakes the student. Note: Using more than 20 will not be reliable
        /// because the Guids will be random
        /// </summary>
        /// <param name="count">The count.</param>
        /// <param name="studentRepository">The student repository.</param>
        /// <param name="specificStudents">The specific students.</param>
        /// <param name="studentRepository2">The student repository2.</param>
        public static void FakeStudent(int count, IRepositoryWithTypedId<Student, Guid> studentRepository, List<Student> specificStudents, IRepository<Student> studentRepository2)
        {
            var students = new List<Student>();
            var specificStudentsCount = 0;
            if (specificStudents != null)
            {
                specificStudentsCount = specificStudents.Count;
                for (int i = 0; i < specificStudentsCount; i++)
                {
                    students.Add(specificStudents[i]);
                }
            }

            for (int i = 0; i < count; i++)
            {
                students.Add(CreateValidEntities.Student(i + specificStudentsCount + 1));
            }

            var totalCount = students.Count;
            for (int i = 0; i < totalCount; i++)
            {
                students[i].SetIdTo(SpecificGuid.GetGuid(i+1));
                int i1 = i;
                studentRepository
                    .Expect(a => a.GetNullableById(students[i1].Id))
                    .Return(students[i])
                    .Repeat
                    .Any();
            }
            studentRepository.Expect(a => a.GetNullableById(SpecificGuid.GetGuid(totalCount + 1))).Return(null).Repeat.Any();
            studentRepository.Expect(a => a.Queryable).Return(students.AsQueryable()).Repeat.Any();
            studentRepository.Expect(a => a.GetAll()).Return(students).Repeat.Any();
            if(studentRepository2 != null)
            {
                studentRepository2.Expect(a => a.Queryable).Return(students.AsQueryable()).Repeat.Any();
                studentRepository2.Expect(a => a.GetAll()).Return(students).Repeat.Any();
            }
        }
Ejemplo n.º 56
0
 public DirectorySearchController(IDirectorySearchService directorySearchService, IRepositoryWithTypedId <User, string> userRepository)
 {
     _directorySearchService = directorySearchService;
     _userRepository         = userRepository;
 }
Ejemplo n.º 57
0
 public AccountController(IRepositoryWithTypedId <User, Guid> userRepository, IRepositoryWithTypedId <Agribusiness.Core.Domain.Membership, Guid> membershipRepository)
 {
     _userRepository       = userRepository;
     _membershipRepository = membershipRepository;
 }
Ejemplo n.º 58
0
 public LocalizationApiController(IStringLocalizerFactory stringLocalizerFactory, IRepository <Resource> resourceRepository, IRepositoryWithTypedId <Culture, string> cultureRepository)
 {
     _localizer          = stringLocalizerFactory.Create(null);
     _resourceRepository = resourceRepository;
     _cultureRepository  = cultureRepository;
 }
Ejemplo n.º 59
0
 public TemplateController(IRepository<Template> templateRepository, IRepositoryWithTypedId<NotificationType, string> notificationTypeRepository)
 {
     _templateRepository = templateRepository;
     _notificationTypeRepository = notificationTypeRepository;
 }
Ejemplo n.º 60
0
 public LocalizationController(IRepositoryWithTypedId <User, long> userRepository, IWorkContext workContext)
 {
     _userRepository = userRepository;
     _workContext    = workContext;
 }