public void Check_CreateSportMenu_MatchCount()
        {
            // Arrange
            var mock        = CreateDataServiceMock();
            var dataMapMock = new DataMapService(mock.Object);

            // act
            var result = dataMapMock.CreateSportMenu();

            // Assert
            Assert.AreEqual(2, result.Count);
            Assert.AreEqual(2, result[0].SportList.Count);
            Assert.AreEqual(4, result[0].SportList[0].MatchCount);
            Assert.AreEqual(3, result[0].SportList[1].MatchCount);
        }
Example #2
0
        private static void UpdateCache()
        {
            // Console.WriteLine("Update cache");

            using (var context = new MsSqlContext())
            {
                var dms = new DataMapService(context);

                var sportMenuList  = dms.CreateSportMenu();
                var eventDetails   = dms.CreateEventDetails();
                var upcomingEvents = dms.CreateUpcomingEvents();

                using (var cacheDb = new MongoContext())
                {
                    cacheDb.ReplaceAll(sportMenuList);
                    cacheDb.ReplaceAll(eventDetails);
                    cacheDb.ReplaceAll(upcomingEvents);
                }
            }
        }