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)); }