public async Task InitializeAsync() { var filePath = Path.Combine(AppContext.BaseDirectory, DataConstants.DAT_FILE_PATH); await using var stream = _readerService.Read(filePath); DatInfo = new DatInfo(stream, 1); var records = DatInfo.Records; var ipIntervalsInformations = new IUserIp[records]; var coordinateInformations = new IUserLocation[records]; for (var index = 0; index < records; index++) { ipIntervalsInformations[index] = new UserIp(stream, index + 1); } for (var index = 0; index < records; index++) { coordinateInformations[index] = new UserLocation(stream, index + 1); } UserIps = new ConcurrentQueue <IUserIp>(ipIntervalsInformations); UserLocations = new ConcurrentQueue <IUserLocation>(coordinateInformations); }
public async Task Read_NotNull_Test() { var path = Path.Combine(Directory.GetCurrentDirectory(), DataConstants.DAT_FILE_PATH); await using var result = _service.Read(path); Assert.NotNull(result); }