コード例 #1
0
 public CreateTransactionForm()
 {
     InitializeComponent();
     stockRepo       = new StockRepository();
     brokerRepo      = new BrokerRepository();
     transactionRepo = new TransactionRepository();
 }
コード例 #2
0
ファイル: DataHelper.cs プロジェクト: zhongping/Equity-Market
 public static void LoadBrokerComboBox(BrokerRepository brokerRepo, ComboBox BrokerComboBox)
 {
     BrokerComboBox.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
     BrokerComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
     BrokerComboBox.DataSource         = brokerRepo.GetBrokerList();
     BrokerComboBox.DisplayMember      = "name";
     BrokerComboBox.ValueMember        = "id";
 }
コード例 #3
0
		public CustomerRelationsModelBuilder(LoanRepository loanRepository, CustomerRelationsRepository customerRelationsRepository, ISession session) {
			_loanRepository = loanRepository;
			_customerRelationsRepository = customerRelationsRepository;
			_customerRelationFollowUpRepository = new CustomerRelationFollowUpRepository(session);
			_customerRelationStateRepository = new CustomerRelationStateRepository(session);
			_customerRepository = new CustomerRepository(session);
			_brokerRepository = new BrokerRepository(session);
			customerPhoneRepository = new CustomerPhoneRepository(session);
			frequentActionItemsRepository = new FrequentActionItemsRepository(session);
			frequentActionItemsForCustomerRepository = new FrequentActionItemsForCustomerRepository(session);
		    collectionStatusHistory = new CustomerStatusHistoryRepository(session);
		    collectionLogRepository = new CollectionLogRepository(session);
		} // constructor
コード例 #4
0
        public void Test_GetAllBrokers_ReturnsAllBrokers()
        {
            //ARRANGE
            var expected = new List <Broker>
            {
                new Broker {
                    id = 1, name = "Batman", companyId = 1
                },
                new Broker {
                    id = 2, name = "Robin", companyId = 1
                },
                new Broker {
                    id = 3, name = "Catwoman", companyId = 1
                }
            };

            var testData = new List <Broker>
            {
                new Broker {
                    id = 1, name = "Batman", companyId = 1
                },
                new Broker {
                    id = 2, name = "Robin", companyId = 1
                },
                new Broker {
                    id = 3, name = "Catwoman", companyId = 1
                }
            }.AsQueryable();

            Mock <DbSet <Broker> > dbSetMock = new Mock <DbSet <Broker> >();

            dbSetMock.As <IQueryable <Broker> >().Setup(d => d.Provider).Returns(testData.Provider);
            dbSetMock.As <IQueryable <Broker> >().Setup(d => d.Expression).Returns(testData.Expression);
            dbSetMock.As <IQueryable <Broker> >().Setup(d => d.ElementType).Returns(testData.ElementType);
            dbSetMock.As <IQueryable <Broker> >().Setup(d => d.GetEnumerator()).Returns(testData.GetEnumerator);

            var contextMock = new Mock <CodeFirstModel>();

            contextMock.Setup(c => c.brokers).Returns(dbSetMock.Object);

            BrokerRepository classUnderTest = new BrokerRepository(contextMock.Object);

            //ACT
            var actual = classUnderTest.GetAllBrokers();


            //ASSERT
            Assert.AreEqual(expected[0].id, actual[0].id);
            Assert.AreEqual(expected[1].id, actual[1].id);
            Assert.AreEqual(expected[2].id, actual[2].id);
        }
コード例 #5
0
ファイル: BrokerRepositoryTests.cs プロジェクト: skhan92/FDM
        public void Test_GetAllBrokers_ReturnsAllBrokers()
        {
            //Arrange
            var expected = new List <Broker>
            {
                new Broker {
                    id = 1, name = "Batman", companyId = 1
                },
                new Broker {
                    id = 2, name = "Robin", companyId = 1
                },
                new Broker {
                    id = 3, name = "Mr Freeze", companyId = 1
                }
            };

            var testData = new List <Broker>
            {
                new Broker {
                    id = 1, name = "Batman", companyId = 1
                },
                new Broker {
                    id = 2, name = "Robin", companyId = 1
                },
                new Broker {
                    id = 3, name = "Mr Freeze", companyId = 1
                }                                                       //deleting previous 3 lines should make test, fail, then you can make it pass by re-inserting.
            }.AsQueryable();

            var dbSetMock = new Mock <DbSet <Broker> >();

            //These 4 lines are always the same, they set up the dbset mock so that it acts like a dbset
            dbSetMock.As <IQueryable <Broker> >().Setup(d => d.Provider).Returns(testData.Provider);
            dbSetMock.As <IQueryable <Broker> >().Setup(d => d.Expression).Returns(testData.Expression);
            dbSetMock.As <IQueryable <Broker> >().Setup(d => d.ElementType).Returns(testData.ElementType);
            dbSetMock.As <IQueryable <Broker> >().Setup(d => d.GetEnumerator()).Returns(testData.GetEnumerator());

            Mock <CodeFirstModel> contextMock = new Mock <CodeFirstModel>();

            contextMock.Setup(c => c.brokers).Returns(dbSetMock.Object);

            BrokerRepository classUnderTest = new BrokerRepository(contextMock.Object); //called classundertest as so many moqs lying around and Im aware which class is being tested

            //Act
            var actual = classUnderTest.GetAllBrokers();

            //Assert
            Assert.AreEqual(expected[0].id, actual[0].id);
            Assert.AreEqual(expected[1].id, actual[1].id);
            Assert.AreEqual(expected[2].id, actual[2].id);
        }
コード例 #6
0
        public async void GetByIdAsync_When_Called_Should_Return_Broker_including_Customers()
        {
            //Arrange
            SoftDbContext _context          = new SoftDbContext();
            var           _brokerRepository = new BrokerRepository(_context);

            //Act
            var firstBrokerInRepository = _context.Brokers.FirstOrDefault();

            Assert.NotNull(firstBrokerInRepository);
            var broker = await _brokerRepository.FindByIdAsync(firstBrokerInRepository.Id);

            //Assert
            Assert.NotEmpty(broker.Customers);
        }
コード例 #7
0
        private static void RunAwbJob(string mainConnectionString, string filesConnectionString, int partitionId)
        {
            using (var connection = new SqlConnection(mainConnectionString))
            {
                var executor            = new SqlProcedureExecutor(mainConnectionString);
                var events              = new EventRepository(executor);
                var adminRepository     = new AdminRepository(connection);
                var brokerRepository    = new BrokerRepository(connection);
                var awbs                = new AwbRepository(connection);
                var converter           = new PasswordConverter();
                var senders             = new SenderRepository(converter, executor);
                var localizedDataHelper = new AwbEventLocalizedDataHelper(awbs, senders);
                var eventEmailRecipient = new EventEmailRecipient(executor);
                var managerRepository   = new ManagerRepository(connection);
                var recipientsFacade    = new AwbEventRecipientsFacade(
                    adminRepository,
                    managerRepository,
                    brokerRepository,
                    awbs,
                    eventEmailRecipient);

                var messageBuilder = GetCommonMessageBuilder(
                    connection,
                    mainConnectionString,
                    filesConnectionString,
                    localizedDataHelper,
                    recipientsFacade);
                var emailingProcessor = GetDefaultEmailingProcessor(partitionId, executor, messageBuilder);

                var processors = (IDictionary <EventState, IEventProcessor>) new Dictionary <EventState, IEventProcessor>
                {
                    { EventState.Emailing, emailingProcessor }
                };

                new SequentialEventJob(
                    events,
                    partitionId,
                    EventHelper.AwbEventTypes.ToDictionary(x => x, x => processors)).Work();
            }
        }
コード例 #8
0
        public Broker GetBrokerDetail()
        {
            var brokerdetail = new BrokerRepository().GetBrokerDetail();

            return(brokerdetail);
        }
コード例 #9
0
        public void BuildImports()
        {
            var json = @"[{'name': 'GROUP BROKER', '_id': '0'},
{'name': 'UPCC SECURITIES CORP.', '_id': '100'},
{'name': 'A & A SECURITIES INC.', '_id': '101'},
{'name': 'ABACUS SECURITIES CORPORA', '_id': '102'},
{'name': 'ACCORD CAPITAL EQUITIES', '_id': '103'},
{'name': 'A.T. DE CASTRO SECURITIES', '_id': '104'},
{'name': 'ALL ASIA SEC. MANAGEMENT', '_id': '105'},
{'name': 'ALPHA SECURITIES CORPORAT', '_id': '106'},
{'name': 'ACTIVE EARNINGS INC.', '_id': '108'},
{'name': 'BA SECURITIES, INC.', '_id': '109'},
{'name': 'ANGPING & ASSOCIATES SECU', '_id': '110'},
{'name': 'ANSALDO, GODINEZ & CO.', '_id': '111'},
{'name': 'AB CAPITAL SECURITIES, IN', '_id': '112'},
{'name': 'SARANGGANI SECURITIES, IN', '_id': '113'},
{'name': 'SB EQUITIES, INC.', '_id': '115'},
{'name': 'ASIA PACIFIC CAPITAL EQUI', '_id': '116'},
{'name': 'ASIAMERIT SECURITIES, INC', '_id': '117'},
{'name': 'ASIASEC EQUITIES, INC.', '_id': '118'},
{'name': 'ASTRA SECURITIES CORPORAT', '_id': '119'},
{'name': 'ATC SECURITIES, INC.', '_id': '120'},
{'name': 'MACQUARIE SECURITIES', '_id': '121'},
{'name': 'BELSON SECURITIES, INC.', '_id': '122'},
{'name': 'BENJAMIN CO CA & COMPANY,', '_id': '123'},
{'name': 'B.H. CHUA SECURITIES CORP', '_id': '124'},
{'name': 'JAKA SECURITIES CORPORATI', '_id': '125'},
{'name': 'BPI SECURITIES CORPORATIO', '_id': '126'},
{'name': 'CAMPOS LANUZA & CO.', '_id': '128'},
{'name': 'SINCERE SECURITIES CORP.', '_id': '129'},
{'name': 'CENTURY SECURITIES CORPOR', '_id': '130'},
{'name': 'PCIB SECURITIES, INC.', '_id': '131'},
{'name': 'PHIL TA SECURITIES, INC.', '_id': '132'},
{'name': 'CITISECURITIES, INC.', '_id': '133'},
{'name': 'CITICORP SECURITIES (RP)', '_id': '134'},
{'name': 'CITYTRUST SECURITIES CORP', '_id': '135'},
{'name': 'TRITON SECURITIES CORPORA', '_id': '136'},
{'name': 'CONNELL SECURITIES,INC.', '_id': '137'},
{'name': 'PHILEOALLIED SECURITIES,', '_id': '138'},
{'name': 'MAGNUM INT L SECURITIES,I', '_id': '139'},
{'name': 'IGC SECURITIES, INC.', '_id': '140'},
{'name': 'CUALOPING SECURITIES CORP', '_id': '141'},
{'name': 'DBP-DAIWA SECURITIES (PHI', '_id': '142'},
{'name': 'DAVID GO SECURITIES CORPO', '_id': '143'},
{'name': 'DIVERSIFIED SECURITIES, I', '_id': '145'},
{'name': 'WISE SECURITIES,INC.', '_id': '146'},
{'name': 'E. CHUA CHIACO SECURITIES', '_id': '147'},
{'name': 'SECURITIES PLUS. INC.', '_id': '148'},
{'name': 'EASTWEST CAPITAL CORPORAT', '_id': '149'},
{'name': 'EASTERN SECURITIES DEVT C', '_id': '150'},
{'name': 'EBC SECURITIES, INC.', '_id': '151'},
{'name': 'RASHID HUSSAIN SECURITIES', '_id': '152'},
{'name': 'EQUITIWORLD SECURITIES,IN', '_id': '153'},
{'name': 'EVERGREEN STOCK BROKERAGE', '_id': '154'},
{'name': 'FEB STOCK BROKERS,INC.', '_id': '155'},
{'name': 'FINVEST SECURITIES (CLOSE', '_id': '156'},
{'name': 'FIRST ORIENT SECURITIES,I', '_id': '157'},
{'name': 'GERONIMO VELASCO JR.', '_id': '158'},
{'name': 'FIRST INTEGRATED CAPITAL', '_id': '159'},
{'name': 'FORTUNE SECURITIES,INC.', '_id': '160'},
{'name': 'FRANCISCO ORTIGAS SECURIT', '_id': '161'},
{'name': 'F.YAP SECURITIES,INC.', '_id': '162'},
{'name': 'UNITED PACIFIC SECURITIES', '_id': '163'},
{'name': 'G.K. GOH SECURITIES (PHIL', '_id': '165'},
{'name': 'AURORA SECURITIES, INC.', '_id': '167'},
{'name': 'GLOBALINKS SECURITIES & S', '_id': '168'},
{'name': 'JSG SECURITIES, INC.', '_id': '169'},
{'name': 'GOLDSTAR SECURITIES, INC.', '_id': '170'},
{'name': 'GUOCO SECURITIES (PHILS),', '_id': '171'},
{'name': 'GUILD SECURITIES, INC.', '_id': '172'},
{'name': 'CHRISTFUND SECURITIES (PH', '_id': '173'},
{'name': 'HDI SECURITIES, INC.', '_id': '174'},
{'name': 'H.E. BENNTT SECURITIES, I', '_id': '175'},
{'name': 'ABN AMRO ASIA SECURITIES', '_id': '176'},
{'name': 'HIGHLAND SECURITIES PHILS', '_id': '177'},
{'name': 'HK SECURITIES (PHILS), IN', '_id': '178'},
{'name': 'I. ACKERMAN & COMPANY, IN', '_id': '179'},
{'name': 'I.B. GIMENEZ SECURITIES,', '_id': '180'},
{'name': 'INVESTORS SECURITIES, INC', '_id': '181'},
{'name': 'IMPERIAL. DE GUZMAN,ABALO', '_id': '182'},
{'name': 'INTRA-INVEST SECURITIES,', '_id': '183'},
{'name': 'DBS VICKERS SECURITIES, (', '_id': '184'},
{'name': 'JP MORGAN SECURITIES', '_id': '185'},
{'name': 'CDIB VENTURE INVESTMENT', '_id': '186'},
{'name': 'ASIAN CAPITAL EQUITIES, I', '_id': '187'},
{'name': 'J.M.BARCELON & COMPANY, I', '_id': '188'},
{'name': 'GEORGE YANG', '_id': '189'},
{'name': 'VALUE QUEST SECURITIES', '_id': '190'},
{'name': 'KEY SECURITIES, INC.', '_id': '191'},
{'name': 'STRATEGIC EQUITIES CORP.', '_id': '192'},
{'name': 'LARRGO SECURITIES COMPANY', '_id': '193'},
{'name': 'LIPPO SECURITIES, INC.', '_id': '194'},
{'name': 'LITONJUA SECURITIES, INC.', '_id': '195'},
{'name': 'L.M.GARCIA AND ASSOCIATES', '_id': '196'},
{'name': 'LOPEZ, LOCSIN, LEDESMA &', '_id': '197'},
{'name': 'LUCKY SECURITIES, INC.', '_id': '198'},
{'name': 'LUY S SECURITIES COMPANY,', '_id': '199'},
{'name': 'MANDARIN SECURITIES CORPO', '_id': '200'},
{'name': 'MARIAN SECURITIES, INC.', '_id': '201'},
{'name': 'MARINO OLONDRIZY CIA', '_id': '202'},
{'name': 'COL FINANCIAL', '_id': '203'},
{'name': 'DA MARKET SECURITIES, INC', '_id': '204'},
{'name': 'MERCANTILE SECURITIES COR', '_id': '205'},
{'name': 'MERIDIAN SECURITIES, INC.', '_id': '206'},
{'name': 'BNP PARIBAS PEREGRINE', '_id': '207'},
{'name': 'MDR SECURITIES, INC.', '_id': '208'},
{'name': 'DEUTSCHE REGIS PARTNERS,', '_id': '209'},
{'name': 'MOUNT PEAK SECURITIES, IN', '_id': '210'},
{'name': 'NEW WORLD SECURITIES, INC', '_id': '211'},
{'name': 'E*TRADE SECURITIES', '_id': '212'},
{'name': 'NIEVES SANCHEZ, INC.', '_id': '213'},
{'name': 'NOMURA INTERNATIONAL (HK)', '_id': '214'},
{'name': 'OPTIMUM SECURITIES CORPOR', '_id': '215'},
{'name': 'RCBC SECURITIES, INC.', '_id': '217'},
{'name': 'PAN ASIA SECURITIES CORPO', '_id': '218'},
{'name': 'PAPA SECURITIES CORPORATI', '_id': '219'},
{'name': 'ATR KIM ENG SECURITIES', '_id': '220'},
{'name': 'PARIBAS ASIA EQUITY, INC.', '_id': '221'},
{'name': 'PIERCE INTERLINK SECURITI', '_id': '222'},
{'name': 'PLATINUM SECURITIES, INC.', '_id': '223'},
{'name': 'PNB SECURITIES,INC.', '_id': '224'},
{'name': 'PREMIUM SECURITIES, INC.', '_id': '225'},
{'name': 'CHILIP CHRISTOPHER', '_id': '226'},
{'name': 'OCBC SECURITIES PHILS.,IN', '_id': '227'},
{'name': 'PRYCE SECURITIES, INC.', '_id': '228'},
{'name': 'PUBLIC SECURITIES CORPORA', '_id': '229'},
{'name': 'QUALITY INVESTMENT & SECU', '_id': '230'},
{'name': 'R & L INVESTMENTS, INC.', '_id': '231'},
{'name': 'ALAKOR SECURITIES CORPORA', '_id': '232'},
{'name': 'R. COYIUTO SECURITIES, IN', '_id': '233'},
{'name': 'PJB PACIFIC SECURITIES (P', '_id': '234'},
{'name': 'REGINA CAPITAL DEVELOPMEN', '_id': '235'},
{'name': 'R. NUBLA SECURITIES, INC.', '_id': '236'},
{'name': 'AAA SOUTHEAST EQUITIES, I', '_id': '237'},
{'name': 'R.S. LIM & COMPANY, INC.', '_id': '238'},
{'name': 'RTG & COMPANY, INC.', '_id': '239'},
{'name': 'S.J. ROXAS & COMPANY, INC', '_id': '240'},
{'name': 'SAPPHIRE SECURITIES, INC.', '_id': '241'},
{'name': 'SECURITIES SPECIALSTS, IN', '_id': '242'},
{'name': 'FIDELITY SECURITIES,INC.', '_id': '243'},
{'name': 'ORION-SQUIRE CAPITAL,INC.', '_id': '245'},
{'name': 'SUMMIT SECURITIES, INC.', '_id': '246'},
{'name': 'STANDARD SECURITIES COPRO', '_id': '247'},
{'name': 'SUN HUNG KAI SECURITIES (', '_id': '248'},
{'name': 'SUPREME STOCKBROKER, INC.', '_id': '249'},
{'name': 'PEARLBANK SECURITIES, INC', '_id': '250'},
{'name': 'TANSENGCO & COMPANY, INC.', '_id': '251'},
{'name': 'THE FIRST RESOURCES MANAG', '_id': '252'},
{'name': 'TOWER SECURITIES, INC.', '_id': '253'},
{'name': 'TRANS-ASIA SECURITIES, IN', '_id': '254'},
{'name': 'APEX PHILS. EQUITIES', '_id': '255'},
{'name': 'TRENDLINE SECURITIES CORP', '_id': '256'},
{'name': 'TRI-SATE SECURITIES, INC.', '_id': '257'},
{'name': 'SG SECURITIES, INC.', '_id': '258'},
{'name': 'UCPB SECURITIES,INC.', '_id': '259'},
{'name': 'UOB KAY HIAN SECURITIES,', '_id': '260'},
{'name': 'EIB SECURITIES, INC', '_id': '261'},
{'name': 'UY-TIOCO & COMPANY, INC.', '_id': '262'},
{'name': 'VENTURE SECURITIES, INC.', '_id': '263'},
{'name': 'VISA SECURITIES CORPORATI', '_id': '264'},
{'name': 'JOCRISON SECURITIES, INC.', '_id': '265'},
{'name': 'VICSAL SECURITIES, INC.', '_id': '266'},
{'name': 'FIRST METRO SECURITIES', '_id': '267'},
{'name': 'HSBC SECURITIES (PHILS),', '_id': '268'},
{'name': 'WEALTH SECURITIES, INC.', '_id': '269'},
{'name': 'WESTLINK GLOBAL EQUITIES', '_id': '270'},
{'name': 'KGI SECURITIES PHILS., IN', '_id': '271'},
{'name': 'BERNAD SECURITIES, INC.', '_id': '272'},
{'name': 'WONG SECURITIES CORPORATI', '_id': '273'},
{'name': 'WORLDSEC INTERNATIONAL SE', '_id': '274'},
{'name': 'YAO & ZIALCITA, INC.', '_id': '275'},
{'name': 'PHIL-PROGRESS SECURITIES,', '_id': '276'},
{'name': 'YAPTINCHAY SECURITIES COR', '_id': '277'},
{'name': 'YU & COMPANY, INC.', '_id': '278'},
{'name': 'BDO SECURITIES CORP.', '_id': '279'},
{'name': 'TOPWIN SECURITIES', '_id': '280'},
{'name': 'PCCI SECURITIES BROKERS C', '_id': '282'},
{'name': 'EAGLE EQUITIES,INC.', '_id': '283'},
{'name': 'GOLDEN TOWER SEC. & HOLDI', '_id': '285'},
{'name': 'SOLAR SECURITIES, INC.', '_id': '286'},
{'name': 'PARAGON STRATEGIC HOLDING', '_id': '287'},
{'name': 'G.D. TAN & CO.', '_id': '288'},
{'name': 'GRAND ASIA SECURITIES, IN', '_id': '289'},
{'name': 'L. M. GARCIA SECURITIES', '_id': '305'},
{'name': 'VC SECURITIES CORPORATION', '_id': '308'},
{'name': 'CREDIT SUISSE SECURITIES', '_id': '311'},
{'name': 'CLSA PHILIPPINES, INC.', '_id': '323'},
{'name': 'DW CAPITAL INC.', '_id': '328'},
{'name': 'UBS SECURITIES PHIL., INC', '_id': '333'},
{'name': 'PHILIPPINE EQUITY PARTNER', '_id': '338'},
{'name': 'UNICAPITAL SECURITIES', '_id': '345'},
{'name': 'SUN SECURITIES', '_id': '368'},
{'name': 'FIVE KARATS PROPERTY HOLD', '_id': '369'},
{'name': 'COHERCO SECURITIES', '_id': '387'},
{'name': 'ARMSTRONG SECURITIES, INC', '_id': '388'},
{'name': 'KINGS POWER SECURITIES', '_id': '389'},
{'name': 'TIMSON SECURITIES', '_id': '488'},
{'name': 'STAR ALLIANCE SECURITIES CORPORATION', '_id': '528'},
{'name': 'PJB PACIFIC SECURITIES', '_id': '692'}]";

            var items            = JsonConvert.DeserializeObject <List <Broker> >(json);
            var brokerRepository = new BrokerRepository("http://127.0.0.1:5984");

            foreach (var item in items)
            {
                brokerRepository.Entities.PostAsync(item);
            }

            Assert.IsTrue(true);
        }
コード例 #10
0
ファイル: BrokerRepositoryTests.cs プロジェクト: UHgEHEP/test
        public void TestInitialize()
        {
            _context = new DbTestContext(Settings.Default.MainConnectionString);

            _repository = new BrokerRepository(_context.Connection);
        }
コード例 #11
0
 /// <summary>
 /// Initialize BrokerRepository repository instances
 /// </summary>
 public BrokerInfoBusiness()
 {
     _brokerRepo = new BrokerRepository();
 }
コード例 #12
0
 public Broker(IMediator mediator, BrokerRepository brokerRepository, Guid brokerId)
 {
     _newYorkStockExchange = mediator;
     _brokerRepository     = brokerRepository;
     _id = brokerId;
 }