public async Task Setup()
        {
            var book = BookBuilder.WithLibrary(LibraryId).Build();

            _bookId = book.Id;
            var imageUrl = DatabaseConnection.GetBookImageUrl(_bookId);

            _oldImage = await FileStore.GetFile(imageUrl, CancellationToken.None);

            _response = await Client.PutFile($"/libraries/{LibraryId}/books/{_bookId}/image", RandomData.Bytes);
        }
Beispiel #2
0
        public SortedDictionary <DateTime, ConsolidatedStockModel> Build(string alphaKey, string ticker)
        {
            SortedDictionary <DateTime, ConsolidatedStockModel> stockDictionary;
            string savedJson = FileStore.GetFile(ticker);

            if (savedJson == string.Empty)
            {
                stockDictionary = GetData(alphaKey, ticker);
                FileStore.StoreFile(ticker, JsonConvert.SerializeObject(stockDictionary), DateTime.Now);
            }
            else
            {
                stockDictionary = JsonConvert.DeserializeObject <SortedDictionary <DateTime, ConsolidatedStockModel> >(savedJson);
            }
            return(stockDictionary);
        }