Ejemplo n.º 1
0
        public void ReturnTheCorrectResultsWhenAskedInLast30DaysExpressionIsUsed()
        {
            var actualResults = new EnumerableStack().Questions.Where(Asked.InLast(30.Days()));

            DisplayPosts(actualResults);
            Assert.AreEqual(93, actualResults.Count());
        }
Ejemplo n.º 2
0
        public void ReturnTheCorrectResultsWhenTheFullQueryExpressionIsUsed()
        {
            var actualResults = new EnumerableStack().Questions.WithAcceptedAnswer()
                                .Where(Asked.InLast(30.Days()))
                                .TaggedWith("odata");

            DisplayPosts(actualResults);
            Assert.AreEqual(2, actualResults.Count());
        }
Ejemplo n.º 3
0
        public void ReturnTheCorrectResultsWhenTaggedWithOdataMethodIsUsed()
        {
            var expectedResults = new StackOverflowService.Entities(new Uri(_stackoverflowServiceRoot)).Posts
                                  .Where(p => p.Parent == null && p.AcceptedAnswerId != null &&
                                         p.CreationDate > DateTime.UtcNow.Subtract(TimeSpan.FromDays(30)) &&
                                         p.Tags.Contains("<odata>"));

            var actualResults = new FluentStack().Questions.WithAcceptedAnswer()
                                .Where(Asked.InLast(30.Days()))
                                .TaggedWith("odata");

            RunComparisonTest(expectedResults, actualResults);
        }