Below is a test class that is driving me crazy. I even tried deleting it via Eclipse but I cannot save to server because of this error. I keep getting the following error message:
System.Exception: Assertion Failed: Expected: Select Name,Id From Account Where Name like '%United Partners%', Actual: Select Id,Name From Account Where Name like '%United Partners%' Stack Trace: Class.TestSearchController.t1: line 18, column 1
I want to blame the wildcards %. Perhaps I am missing something more fundamental. Please point this scrub in the right direction.
Test Class below:
@isTest
private class TestSearchController{
public static testmethod void t1(){
Set<String> displayFieldNames = new Set<String>();
displayFieldNames.add('Id');
displayFieldNames.add('Name');
String tableName = 'Account';
Map<String, String> searchFieldValues = new Map<String, String>();
searchFieldValues.put('Name', 'United Partners');
List<String> defaultWhereClause = new List<String>();
String result = 'Select Name,Id From Account Where Name like \'%United Partners%\'';
String query = SearchLib.buildQueryString( tableName, displayFieldNames, defaultWhereClause, searchFieldValues, new Map<String, String[]>() );
System.assertEquals( result,query );
}