public void FindPrefix_NoMatchingSymbols_ReturnsEmptyList() { var companyInfoProvider = new CompanyInfoProvider(this.testData); var result = companyInfoProvider.FindPrefix("Z"); Assert.Empty(result); }
public void FindPrefix_EmptyPrefix_ReturnsAll() { var companyInfoProvider = new CompanyInfoProvider(this.testData); var result = companyInfoProvider.FindPrefix(""); Assert.Equal(this.testData, result); }
public void FindPrefix_OnlyOneSymbolMatchesExactly_ReturnsMatchedSymbol() { var companyInfoProvider = new CompanyInfoProvider(this.testData); var result = companyInfoProvider.FindPrefix("B"); var expectedResult = new List <SymbolDescription> { new SymbolDescription { Symbol = "B" } }; Assert.Equal(expectedResult, result); }
public void FindPrefix_NonzeroOffset_ReturnsAllMatchingSymbolsAfterOffset() { var companyInfoProvider = new CompanyInfoProvider(this.testData); var result = companyInfoProvider.FindPrefix("AA", offset: 2); var expectedResult = new List <SymbolDescription> { new SymbolDescription { Symbol = "AAZ" }, }; Assert.Equal(expectedResult, result); }
public void FindPrefix_NonzeroCount_ReturnsCountOfMatchingSymbols() { var companyInfoProvider = new CompanyInfoProvider(this.testData); var result = companyInfoProvider.FindPrefix("AA", 2); var expectedResult = new List <SymbolDescription> { new SymbolDescription { Symbol = "AA" }, new SymbolDescription { Symbol = "AAA" }, }; Assert.Equal(expectedResult, result); }
public void FindPrefix_PrefixMatchingMultipleSymbols_ReturnsAllMatchingSymbols() { var companyInfoProvider = new CompanyInfoProvider(this.testData); var result = companyInfoProvider.FindPrefix("AA"); var expectedResult = new List <SymbolDescription> { new SymbolDescription { Symbol = "AA" }, new SymbolDescription { Symbol = "AAA" }, new SymbolDescription { Symbol = "AAZ" }, }; Assert.Equal(expectedResult, result); }
public void FindPrefix_OffsetIsOutOfRange_Throws() { var companyInfoProvider = new CompanyInfoProvider(this.testData); Assert.Throws <ArgumentOutOfRangeException>(() => companyInfoProvider.FindPrefix("A", offset: -1)); }
public void FindPrefix_CountIsOutOfRange_Throws(int count) { var companyInfoProvider = new CompanyInfoProvider(this.testData); Assert.Throws <ArgumentOutOfRangeException>(() => companyInfoProvider.FindPrefix("A", count)); }
public void FindPrefix_PrefixIsNull_Throws() { var companyInfoProvider = new CompanyInfoProvider(this.testData); Assert.Throws <ArgumentNullException>(() => companyInfoProvider.FindPrefix(null)); }
public ValuesController(IStockProvider stockProvider, CompanyInfoProvider companyInfoProvider, IDistributedCache cache) { this.stockProvider = stockProvider ?? throw new System.ArgumentNullException(nameof(stockProvider)); this.companyInfoProvider = companyInfoProvider ?? throw new System.ArgumentNullException(nameof(companyInfoProvider)); this.cache = cache ?? throw new System.ArgumentNullException(nameof(cache)); }
public UpdateParser(ITelegramBot telegramBot, IStockProvider stockProvider, CompanyInfoProvider companyInfoProvider) { this.telegramBot = telegramBot ?? throw new ArgumentNullException(nameof(telegramBot)); this.stockProvider = stockProvider ?? throw new ArgumentNullException(nameof(stockProvider)); this.companyInfoProvider = companyInfoProvider ?? throw new ArgumentNullException(nameof(companyInfoProvider)); }