public void InvalidCastOnPropertyNamesPartialStartTest()
 {
     //Using a badobject
     var badCollection = CreateBadObjects();
     var badTarget = new SearchList<BadObject>(badCollection);
     const string searchTerm = "maakt niet uit";
     var propertyNames = new[] { "ID", "Name" };
     var badActual = badTarget.SearchCollection1PartialStartSearchTermAllProperties(searchTerm, propertyNames);
     Assert.IsNull(badActual);
 }
 public void SearchCollectionIsNullTest()
 {
     var target = new SearchList<HelpItem> { SearchCollection = null };
     const string searchTerm = "Help omschrijving 4";
     var actual = target.SearchCollection1SearchTerm(searchTerm, PropertyName);
     Assert.AreEqual(actual, null);
     actual = target.SearchCollection1SearchTermAllProperties(searchTerm, _propertyNames);
     Assert.AreEqual(actual, null);
     const string partialSearchTerm = "speci";
     actual = target.SearchCollection1PartialSearchTermAllProperties(partialSearchTerm, _propertyNames);
     Assert.AreEqual(actual, null);
     actual = target.SearchCollection1PartialStartSearchTermAllProperties(partialSearchTerm, _propertyNames);
     Assert.AreEqual(actual, null);
 }
 public void PartialStartSearchTermIsnullTest()
 {
     try
     {
         //test 1 partial searchterm multiple propertynames
         var target = new SearchList<HelpItem> { SearchCollection = new List<HelpItem>(_helpItemsPartialTests) };
         target.SearchCollection1PartialStartSearchTermAllProperties(null, _propertyNames);
     }
     catch (Exception ex)
     {
         Assert.AreEqual(ex.GetType(), typeof(ArgumentNullException));
         Assert.AreEqual(ex.Message,
                        Thread.CurrentThread.CurrentCulture.Name == "nl-NL"
                            ? "Search term mag niet null zijn\r\nParameternaam: searchTerm"
                            : "Search term mag niet null zijn\r\nParameter name: searchTerm");
     }
 }
 public void SearchCollection1PartialStartSearchTermTest()
 {
     //Happy flow
     var searchCollection = new List<HelpItem>(_helpItemsPartialTests);
     var target = new SearchList<HelpItem>(searchCollection);
     const string searchTerm = "He";
     const int expected = 5;
     var actual = target.SearchCollection1PartialStartSearchTermAllProperties(searchTerm, _propertyNames);
     Assert.AreEqual(expected, actual.Count);
     Assert.AreEqual(searchCollection[0], actual[3]);
     Assert.AreEqual(searchCollection[1], actual[4]);
 }
 public void PartialStartPropertyNamesAreNullTest()
 {
     var target = new SearchList<HelpItem> { SearchCollection = new List<HelpItem>(_helpItems) };
     const string searchTerm = "HelpDescription";
     var actual = target.SearchCollection1PartialStartSearchTermAllProperties(searchTerm, null);
     Assert.AreEqual(actual, 0);
 }