Exemple #1
0
        public string Should_return_correct_latest_by_single_key(string sym)
        {
            var latestIds = ExecuteLatestBySymUtil.ExecuteLambda(items =>
                                                                 from q in items
                                                                 where q.Sym == sym
                                                                 select q, 1);

            return(latestIds);
        }
Exemple #2
0
        public void Should_return_correct_latest_limted_timestamps2()
        {
            var latestIds = ExecuteLatestBySymUtil.ExecuteLambda(items =>
                                                                 from q in items
                                                                 where q.Timestamp >= 290
                                                                 select q, 1);

            Assert.That(latestIds, Is.EqualTo("299,298,297,296,295,294,293,292,291,290"));
        }
Exemple #3
0
        public void Should_return_correct_latest_limted_timestamps3()
        {
            var latestIds = ExecuteLatestBySymUtil.ExecuteLambda(items =>
                                                                 from q in items
                                                                 where q.Timestamp >= 90 && q.Timestamp < 100
                                                                 select q, 1);

            Assert.That(latestIds, Is.EqualTo("99,98,97,96,95,94,93,92,91,90"));
        }
Exemple #4
0
        public string Should_return_correct_latest_filtered_by_another_symbol(string ex)
        {
            var latestIds = ExecuteLatestBySymUtil.ExecuteLambda(items =>
                                                                 from q in items
                                                                 where q.Ex == ex
                                                                 select q, 1);

            return(latestIds);
        }
Exemple #5
0
        public string Should_return_correct_latest_filtered_by_another_column(double size)
        {
            var latestIds = ExecuteLatestBySymUtil.ExecuteLambda(items =>
                                                                 from q in items
                                                                 where q.Ask == size
                                                                 select q, 1);

            return(latestIds);
        }
Exemple #6
0
        public string Should_return_correct_latest_filtered_by_int_column_contains(int[] sizes)
        {
            var latestIds = ExecuteLatestBySymUtil.ExecuteLambda(items =>
                                                                 from q in items
                                                                 where sizes.Contains(q.AskSize)
                                                                 select q, 1);

            return(latestIds);
        }
Exemple #7
0
        public string Should_return_correct_latest_by_list_of_keys(string sym)
        {
            var symbols   = sym.Split(',');
            var latestIds = ExecuteLatestBySymUtil.ExecuteLambda(items =>
                                                                 from q in items
                                                                 where symbols.Contains(q.Sym)
                                                                 select q, 1);

            return(latestIds);
        }
Exemple #8
0
        public string Should_return_latest_by_int(string askSizes)
        {
            var sizes     = askSizes.Split(',').Select(int.Parse).ToArray();
            var latestIds = ExecuteLatestBySymUtil.ExecuteLambda(items =>
                                                                 from q in items
                                                                 where sizes.Contains(q.AskSize)
                                                                 select q, 1, q => q.AskSize);

            return(latestIds);
        }
Exemple #9
0
        public void Should_return_correct_latest_with_nulls()
        {
            var latestIds = ExecuteLatestBySymUtil.ExecuteLambda(items => items, 1, true);

            Assert.That(latestIds, Is.EqualTo("299,298,297,296,295,294,293,292,291,290,289,288,287,286,285,284,283,282,281,280"));
        }