public void KeyDataSourceTests_InsertNull_OK() { var dataSource = new KeyDataSource <Answer>(); Assert.Null(dataSource.Insert(null)); Assert.Null(dataSource.Find(null)); Assert.Null(dataSource.FindTopItems(null)); Assert.Null(dataSource.FindExact(null)); }
public void KeyDataSourceTests_Find_Finds() { var setup = new TestSetup(); var indexDataSource = new KeyDataSource <Answer>(); indexDataSource.Initialize(setup.AnswerRepository, 0); // Pick the first item var key = setup.AnswerRepository.Active().First().IndexKey; // make sure that index key from this item is only in the index once // Although generally this might not be the case if index has something with key + something. // But for now let's leave it like this. Will be interesting to see if tests break because // of that at some point. var result = indexDataSource.Find(key).Count(); Assert.Equal(result, 1); // Search on null Assert.Null(indexDataSource.Find(null)); }