@IsTestprivateclassTest_B25_Reservation{@isTestprivatestaticvoidtestDimensionJunctions(){B25__Reservation__creservation=newB25__Reservation__c();reservation.B25__Start__c=DateTime.now();reservation.B25__End__c=DateTime.now().addHours(1);Database.insert(reservation);<YOUROBJECT>__cyourobject=new<YOUROBJECT>__c();//replacethiswiththenameofyourobjectyourobject.Name='a';//ifthisisfieldisanautonumberyoudontneedthis.Database.insert(yourobject);Reservation_<YOUROBJECT>__cresYourobject=newReservation_<YOUROBJECT>__c();//replaceReservation_<YOUROBJECT>__cwiththenameofyourdimensionjunctionobjectresYourobject.Reservation__c=reservation.Id;resYourobject.<YOUROBJECT>__c=yourobject.Id;//replacethiswiththenameofthelookuponthedimensionjunctionDatabase.insert(resYourobject);System.assertEquals(1,[SELECT Id FROM B25__Reservation__c].size());}}
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.