public async Task SetUp() { _db = new YgoProAnalyticsDatabase(SqlInMemoryHelper.SqlLiteOptions <YgoProAnalyticsDatabase>()); await _db.Database.EnsureCreatedAsync(); _analyzer = new ServerActivityAnalyzer(_db); }
public void SetUp() { _db = new YgoProAnalyticsDatabase(SqlInMemoryHelper.SqlLiteOptions <YgoProAnalyticsDatabase>()); _db.Database.EnsureCreated(); _cacheMock = new Mock <IMemoryCache>(); _configMock = new Mock <IAdminConfig>(); _banlistService = new BanlistService(_db, _cacheMock.Object, _configMock.Object); }
public void SetUp() { _db = new YgoProAnalyticsDatabase(SqlInMemoryHelper.SqlLiteOptions <YgoProAnalyticsDatabase>()); _db.Database.EnsureCreated(); _decklistToDtoConverter = new Mock <IDecklistToDecklistDtoConverter>(); _decklistService = new Mock <IDecklistService>(); _adminConfigMock = new Mock <IAdminConfig>(); _mapperMock = new Mock <IMapper>(); _decklistBrowserQueryParamsValidator = new Mock <IDecklistBrowserQueryParametersDtoValidator>(); _numberOfResultsHelper = new Mock <INumberOfResultsHelper>(); }
public async Task GetPureArchetypeListWithIdsAndNamesAsNoTrackingFromCache_WeHaveOnePureArchetypeInDb_WeGetOneValidDTO() { var cacheMock = new Mock <IMemoryCache>(); var configMock = new Mock <IAdminConfig>(); using (var db = new YgoProAnalyticsDatabase(SqlInMemoryHelper.SqlLiteOptions <YgoProAnalyticsDatabase>())) { await db.Database.EnsureCreatedAsync(); db.Archetypes.Add(new Archetype(Archetype.Default, true)); await db.SaveChangesAsync(); var archetypeService = new ArchetypeService(db, cacheMock.Object, configMock.Object); var resultDto = (await archetypeService.GetPureArchetypeListWithIdsAndNamesAsNoTrackingFromCache(true)) .First(); Assert.IsTrue(resultDto.Name == Archetype.Default); } }
public async Task GetPureArchetypeListWithIdsAndNamesAsNoTrackingFromCache_WeHaveOnePureArchetypeInDbAndTwoNonPure_WeGetOneDto() { var cacheMock = new Mock <IMemoryCache>(); var configMock = new Mock <IAdminConfig>(); using (var db = new YgoProAnalyticsDatabase(SqlInMemoryHelper.SqlLiteOptions <YgoProAnalyticsDatabase>())) { await db.Database.EnsureCreatedAsync(); db.Archetypes.Add(new Archetype(Archetype.Default, true)); db.Archetypes.Add(new Archetype("NotPure", false)); db.Archetypes.Add(new Archetype("NotPure2", false)); await db.SaveChangesAsync(); var archetypeService = new ArchetypeService(db, cacheMock.Object, configMock.Object); var numberOfDtos = (await archetypeService.GetPureArchetypeListWithIdsAndNamesAsNoTrackingFromCache(true)) .Count(); Assert.AreEqual(1, numberOfDtos); } }
public void SetUp() { _db = new YgoProAnalyticsDatabase(SqlInMemoryHelper.SqlLiteOptions <YgoProAnalyticsDatabase>()); _db.Database.EnsureCreated(); _banlistServiceMock = new Mock <IBanlistService>(); }