Example #1
0
        /// <summary>
        /// Calls LoadInvestorsAndLoadUsersMarkets as InvestorIndustriesLoader does it.
        /// </summary>
        /// <param name="startId"></param>
        /// <param name="endId"></param>
        void RunLoadInvestorsAndLoadUsersMarkets(int startId, int endId)
        {
            var loader = new InvestorIndustriesLoader(AngelListClient, defaultLogWriter);

            // Restrict endId to the max allowed value.
            int end = paramParser.RestrictIntRange(startId, endId);

            loader.LoadInvestorsAndLoadUsersMarkets(startId, end);
        }
        public void Load(int startId, int endId)
        {
            // Restrict endId to the max allowed value.
            int end = paramParser.RestrictIntRange(startId, endId);

            if (end != endId)
            {
                string message = string.Format("Restricting end id {0} to {1}.", endId, end);
                defaultLogWriter.Write(message);
            }

            LoadInvestorsAndLoadUsersMarkets(startId, end);
        }
Example #3
0
        public void RestrictIntRange_Success()
        {
            var paramParser = new QueryParameterParser(2, 2);

            int end = paramParser.RestrictIntRange(1, 1);

            Assert.AreEqual(1, end);

            end = paramParser.RestrictIntRange(1, Int32.MaxValue);
            Assert.AreEqual(4, end);

            end = paramParser.RestrictIntRange(1, paramParser.MaxRangeLength);
            Assert.AreEqual(2, end);

            end = paramParser.RestrictIntRange(1, paramParser.MaxRangeLength + 1);
            Assert.AreEqual(paramParser.MaxRangeLength + 1, end);

            end = paramParser.RestrictIntRange(1, paramParser.MaxRangeLength * paramParser.MaxRanges);
            Assert.AreEqual(paramParser.MaxRangeLength * paramParser.MaxRanges, end);

            end = paramParser.RestrictIntRange(1, paramParser.MaxRangeLength * paramParser.MaxRanges + 1);
            Assert.AreEqual(paramParser.MaxRangeLength * paramParser.MaxRanges, end);
        }