Esempio n. 1
0
        public void ReturnsEmptyArrayIfCountIsZero()
        {
            using (var file = new TempFile())
                using (var db = new LiteDbAdapter(file.Filename))
                {
                    foreach (var match in TestData.Matches)
                    {
                        db.AddMatchInfo(match);
                    }

                    db.GetRecentMatches(0).Should().BeEmpty().And.BeAssignableTo <IList <MatchInfo> >();
                }
        }
Esempio n. 2
0
        public void ReturnCorrectMatchesCount()
        {
            using (var file = new TempFile())
                using (var db = new LiteDbAdapter(file.Filename))
                {
                    foreach (var match in TestData.Matches)
                    {
                        db.AddMatchInfo(match);
                    }

                    var sortedMatches = db.GetRecentMatches(3);
                    sortedMatches.Select(x => x.timestamp).Should().Equal(TestData.Timestamps.Take(3));
                }
        }