You can refer this link [An Introduction to Apex Code Test Methods][1] [1]: https://developer.salesforce.com/page/An_Introduction_to_Apex_Code_Test_Methods to start writing test classes. Below I have tried to show you following things: 1. How to create setup data. 2. How to create user for which you will run the test scenarios. @isTest public class clsOpportunity10_Test{ @testSetup static void prepareControllerClassData() { //retrieve the profile information Map<String,Id> profileIdNameMap = TestUtil.prepareProfileIdNameMap(); //create Executive user. User mbExecutiveUser = TestUtil.createUser('Executive', 'user', profileIdNameMap.get('Executive')); System.runAs(mbExecutiveUser) { createOpportunities(); } } // create an user for the test class public static User createUser(String firstName, String lastName, String profileId){ String sRandom = String.ValueOf(Integer.valueOf(math.rint(math.random()*1000000))); User newUser = new User( ProfileId = profileId, Firstname=firstName, Lastname=lastName, Username = firstName + sRandom + '@xyz.com', Alias = firstName.substring(0,2) + lastName.substring(0,2), Email=firstName + lastName + '@xyz.com', EmailEncodingKey='UTF-8', LanguageLocaleKey='en_US', LocaleSidKey='en_US', TimeZoneSidKey='America/Chicago' ); return newUser; } public static Map<String,Id> prepareProfileIdNameMap() { if(profileIdNameMap.isEmpty()) { List<Profile> lstProfile = [SELECT Id, Name FROM Profile WHERE Name IN (<specify all the profile names>)]; for(Profile objProfile:lstProfile) { profileIdNameMap.put(objProfile.Name, objProfile.Id); } } return profileIdNameMap; } public static void createOpportunities() { List<Opportunity> lstOpportunity = new List<Opportunity>(); Opportunity oppty1 = new Opportunity(); oppty1.RecordTypeId= Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('Construction').getRecordTypeId(); oppty1.StageName = 'Needs Qualifying'; oppty1.Branch__c = '10 - Western PA'; //assign all the values to be respective attributes lstOpportunity.add(oppty1); //same way for other stages and branches create opportunity data. //and finally insert the list insert(lstOpportunity); } public static void updateOpportunities() { System.runAs(mbExecutiveUser) { //you will retrieve the opportunity record //update the record //put System.assert() to verify values } }}