You need to sign in to do that
Don't have an account?
Test class : Assertion failed: same value :null
I made this testclass which handles cases + and cases contains account + setup information. Now I'm getting this error :
System.AssertException: Assertion Failed: Same value: null and I don't understand where this is coming from?
@isTest
private class AMobileHandlerTest {
static testMethod void saveCaseTest() {
// String account = ...;
String connId = '12345678';
String buyersID = 'bid';
String classification = 'P3';
String subject = 'Unit test subject';
String description = 'Unit test description';
Account ma = new account();
ma.Name = 'test account';
RecordType recordTypeMa = [ select Id, Name from RecordType where SObjectType = 'Account' and Name = 'Main Account' LIMIT 1];
ma.RecordTypeId = recordTypeMa.Id;
insert ma;
Account ac = new account();
ac.ParentId = ma.Id;
ac.Name = 'test account';
ac.ShippingCity = 'oulu';
ac.ShippingCountry = 'finland';
ac.ShippingPostalCode = '90550';
ac.ShippingState = 'na';
ac.ShippingStreet = 'eletie';
RecordType recordType = [ select Id, Name from RecordType where SObjectType = 'Account' and Name = 'Site' LIMIT 1];
ac.recordTypeId = recordType.Id;
insert ac;
System.assertNotEquals(null, ac.Id);
Setup__c setuppi = new Setup__c();
setuppi.Name = 'test';
setuppi.SOC_LL_ID__c = connId;
setuppi.site__c = ac.Id;
insert setuppi;
System.assertNotEquals(null, setuppi.Id);
// AMobileHandler hndlr = new AMobileHandler();
Test.startTest();
string id = AMobileHandler.saveCase(connId, buyersId, classification, subject, description);
Test.stopTest();
System.assertNotEquals(null, id);
Its impossible to tell without knowing what the AMobileHandler.saveCase() method does.