We are going to do some programming. So, we are doing some sandboxes or we are doing some some test environment code and after our event completed we will move to production okay. Yeah you take the batch or you made it similar or you made it trigger. So, once your logic develop complete, then you have to move that changes to the production. Okay. So now, before going into production, the functionality for what you are writing the code, then able to test it that test maybe your unit test or maybe test by the testing team.
Okay. So whenever we're doing unit tests, that means you will check the check the flow in the way you open the pages and treat the flow is working as expected or not. And secondly, you can write some piece of code to test it also. Okay, that means it does a functional testing Do we know what I'm doing unit testing? How I do? Okay, we can see what's going good.
Yeah. Whenever I'm going to do unit testing, how I do the testing programmability and what are things I need to see for the unit testing? Okay. Now, whenever I'm doing the unit testing what's going to happen? So let's see you will have written was one small program called a calculator. Okay.
In calculator, you functionally ledger isn't the only like subtraction we have completely like multiplication. So, whenever you write a unit test as per this, then you will give the input to this functionality to this method. And you will see the residual is happening as you're executing on that is it only the test incurred? If Yeah, if you are going to input five and three, four that isn't it expect the deletion to eight or not? So whenever you're going to disclose, you should write the test cases in such a way that your functionality would cover like this. Okay?
You should test for a single record. Okay, pass a single record to the diskless. Okay? And check the functional to working for is one record or not, okay? Then do testing for bulk record, okay, multiple records also and they'll in your methods, okay. Then check for the positive scenario like LTL okay.
In a past 500 to my method, inputs would be three outputs would be eight, and in the same thing, you would check the negative scenario. Okay? That means you perhaps are vibrantly ritual should not be nine. Yes, good. And also, you should choose the uteruses. That means they're sick.
Is a method, I didn't give permission to all of you just to use it, I gave only permission to you, okay? And I will check if somebody logged in, okay, who is not you? Okay, if somebody else logged into the system, then they cannot execute this method that also should test. So whenever I'm writing in this class, I should, I should write a single record public or policy scenario negative scenario, and reduces in how I am going to write it. So whenever I'm telling class, this class, that's when you're starting, but it's a simple this simple app is slow, but that class should behave as if this class Okay, so whenever you have your class and it I want it to be a class, I use some interface that is spelled watchable, or to do a user interface system does the same way. Whenever you want any class to be diskless you want to notice Color at the red is test if I notice a lot is tears in that class is going to be diskless either I think something like this he'll probably close as flat as see, if I don't have this under the sun that is just a class for you give me some wisdom.
That means you said yes to us. So whenever I take class, then using this class, I can explain logic. Okay. One more point Olivia should remember, whenever we're going to declare that you're going to deploy to production, or will production we check how much code coverage you in a sense how much this was you wrote, or you're constantly, always need at least 70 paper in the code coverage for classes, or at least 1% code coverage for the trigger. is a minimum requirement. You don't have this much code coverage and you cannot deploy the classes or two we cannot deploy any epics to the production.
Okay. Let me log into the system is So I have some templates. I have some classes for that class. I write this as a tendency. See, whenever you whenever you're going to log into sandbox, then you test yourself. Or I'm working the Developer Edition.
I'm going to log into software testing. It's a different site, is it? Yes. I extended it up About everything. So, we have one production environment which is live and all a new testing. So whenever logging is is should be login.salesforce.com okay and and also it is the party three account we have in the Developer Edition that is also you can log in in salesforce.com log in yourself.
So, now we distinguish security we have one one CRM application here and all these we are going to make something just we cannot turn the directory in production. So, we should make some education so far this person we make copy some some toner indeed. Okay. And we have different lots of different projects we have different columns, okay, now, these are I will call it sandbox. So, to log into sandbox, you should use this dot six footer okay. So now I'm in the deliberation and I look into ourselves further.
Yeah. Okay, so I have some glasses for the herniated disc. So how this is going to operate, and also how I'll see how much cool is covered in my in my class. Let's see what are the classes I have no perfect diskless I will write this position badge or this badge I'm going to write difference. And I will see how this is going to happen. So now see the code coverage universal.
Okay. So now let's see I'll see which lines covered or not by the blue console, open the developer console. classes you want to see should match then see the coverage on even today no line is covered. Okay. I'm going to discuss for this political party I'm going to do so these tests these classes are going to do it is going to take all position and in this place intelligence status, who is going to operate okay. So now I have to write coverage for this.
So now we will publish these that means it will call me intellectual and it will update the position shutters that means I should test other position records. So I should create it is for you I hope you take Lascaux okay. is okay. So now, if we'll see this class this class is normally a base class, but I want to make these editors class to make this I should give some extra behavior to this. That is by Andersen I use at the date is test the equivalence class numbered in this class okay. So, now inside this class which I should have some methods you will actually get now I will write some test methods like it this method see if I'm writing something like this public employer um let's see test one something like that that doesn't mean this maturity test or it isn't a simple method when you want to any method is better use the keyword test method already already also you can use the same as it is to some new testament on then this we will have this test material is going to change is not a simple matter which you can make a public case with regard so these methods will be static method.
Okay See, if I tried to say was killing it's really starting with them. Voice acting in the static enemy setting the first can be called a class named Only to insensitive. So to Rhonda tasteless, I'm not going to instance it in this class directly. Okay. Now this is me. So now in this judgmental what I need is to create some petition for in I can test it.
So what I'm going to do here, I'm creating a test data for setting up the Tokyo data. How we'll do so now, for my class I need something I need some paper which I will carry an electrical tape over. Let's see how I'll do this. So now I need to do the equation Can you hear me? So finding good police police shouldn't occur. So let me go here.
So what are the minimum things I need to kill the police Can you hear me? Yeah, never says sir. Okay, so I'm going to share some reasons why an infant including operations. So see so I was not able to see the test method that you have written here now you can see the poison paste. Okay, yeah, that entry. So we're going to create a new poison record and I have to specify a position name and all the informations okay.
So I got this information and he lets you save it. Eventually quiz number two is saving. Okay. I can eat and they can say no to something. I will do a lot of thing. I'm just simply telling the person never check.
Okay. So non digital puzzle. Let's see, I wrote one police Name equal to a Cheeto name fill it up anyway. So, I want to use a name we don't name it. Okay? For now, we'll just name it our job I guess.
Okay. Now insert single record. So now for this record, I don't I want to make it test. So what I'll do is so now all these I have the class which I want to test for the position bestest. So, you position restless and I want to destroy this channel, but the techniques I should call these methods. So, how will you do individually to execute this class, I need to call this object on a call center by a tensor this class of Toby's Are you We see that need to be agile.
If you've seen normal methods and what it can do p dot method name you can call it. If it's a normal normal class, where you see it as colors. Whatever you do, you integrate it using the database. Good batch Oh, this graduated. I'm just going to test this what's going to happen here. So now I'm going to dawn in his class this batch job after running Waterloo, I'm expecting for this poison pill will be changed.
Let me call it is poison. Now going into the reason I give only name field, I ran the bad job after running the batch job. I will check what I have. Apparently bad job I'm just pulling this puppy and I will see it is updated or not Hopefully we can just put t ID equal to and then we're going to system dot assert. I'm turning the petition party is Under status change, nautical on initial one, enter One intuitive line number five is script. She says, Yeah, yeah, sometimes the screen is breaking and I'm in your voice is breaking.
I can't hear you and I'm not able to see the screen. So now it's okay. Okay, so what I did, I cleared the question record here. Okay. So see here with creating the record or into only the Name field. Okay, yeah, that's what it sounds so I didn't include any value for the status change, initially status and a non trade.
So after that I ran this batch job. Okay. To run the bedroom. I used police in the capability to advise for the police and catch instances when I did an absolutely fundamental dilemma which apparently bad job so as for my battery's killing it will change this field then according to Sam record who to insert that it will poison it like go to insert here okay then I saw these prints should not be known to obliterate something okay so I'm so now I save it so once you save it then I'll run it and I will check for that thing so on this single diskless you can go on and on test that when it will run this test class only. Okay so hold on, we'll go to testing tuition paid to so if you're only gonna see you still not see anything you go here. So why is Phil assert or certainly certainly as an appraiser credit this line 11 color this is what is notable about it is till now Okay, so now it's a bad job.
So, now our job is to do in the open this bad job electrical in a synchronous mode. Okay, as soon as more in the sense you just give the operations to trigger any to start up okay. It's not going to wait for the next moment it really could continue in the opposite you know the dependent inclusions increments yeah okay. So is running in a single network discusses will run in the synchronous mode. So, in single instance to the surgeon line by line you start with intuition. But now, as I said that class is not going to execute in synchronous mode, in although lines will execute in synchronous, but only these two line eight and line is going to do coding as soon assume the most.
So now the cursor is an interesting over the nice end Okay, there should be a solution of the battable thing. We'll get it very cool as a synchronous motors, yes. It will be nothing more, then it's in back in background repurposing. No, I don't know. So in this we'll go over and before that, I may try to execute these two line decision learning in the passing grace mode. Okay?
And then I may not get this as well present, what I'm going to do, I keep everything in something called algo tester stack test. Okay, so here's a concrete stop stop. So, always remember to you see, this pattern is all about inserting my data or setting up my test. Then my actual testing cycle always you try to use this third stack test and test or stop tears in your discusses. Okay, okay. So what will the Ensure.
So, whenever you lose this case of stack test and test or stop test, it is going to execute in separate context that means, so your datacenter okay you have limitations. So, when it came here you have okay one B one a percent portfolio like this lot of system resource for you whatever you always always pointed there. Yes, yes for going ahead, this will start this this block of code, which you wrote insert static and stop this, this block of code is going to start inside this context does not take this tester status outline it for me I sent you the link also which you need to follow. See this many different portfolios you need to do Same thing we would start stop testing. Is there any mystery you can't sing? Do I need to have any class of test?
No, no nothing to do yesterday This is just method just apart from that nothing we need a dozen signatures to start this okay. All problem what is C? Basically, I wouldn't test that test. So that means this class where other mechanical detectors failed Yeah. Now I see the mistake either on these test cases system was well we were referring system class but to us On paper learning with your class enamel test also so it's trying to report you know to the test already there is a test class is it that's why it is looking for that. Good.
Okay it's a pretty good I have a class mine Okay, let me close this we'll see how many lines getting covered Hello, come here for the coverage coverage 100% So, each line which line would cover then that line is going to be set as though like is it in some electric similar will come in right now ladies with me to change factors everything to do so basically how we relate to that thing like what is the main functions it will consider is used to a PC bad job we will go back over here. Yeah, that is covered okay. So now let's consider one one small class I'm writing a small class and you can see how it's normal being for the class okay? Could be a calculator Class A simple class mostly. Okay, so now there is one small method I am going to try to tasteless parties and how it's going to happen Going to the live should be static.
Okay? We're not going to return anything. Okay, so now I need to test this one. So to take this one that means I need to call this Yes. So I'm going to instantiate it. Okay, then I need to call this one I call Sweetwater past five and three.
Okay? So now she is to return me one minute. Hello. Hello this much. Okay, so now if we find logic to properly they need to return a pipe closeable eight then now it's called or not. Then you use system dot assert equals.
You have same same thing in different assortments. Yeah, same thing. So we're expecting eight and actual values while data equals correct. Yeah, it will dispatch will fail. There's a to my expect value 10 that means my diskless would correct yes. So I ran the test, see, these tests will fail.
So that means my, in my logic, I'm excluding 10, but not giving two in that when we logically don't, but actually, I should expect it. I hear eight, okay. So if you want further negative scenario you pass on Hello. You will Okay, I want to extract this like 10 iF 10 in the sense, this is going to be negative assert not equals. So whatever it may be results will not be 10 Okay. So like this you should check it you don't just now see if I don't if I'm expecting 830 per segment I pass it info on it will give me the struggle and it will see the coverage you go to here on this class.
So, he had this class completely now called the Euro, I just refresh it she the core coverage, hundred percent okay. So now see in this test class, okay. So what do we need? We have inserted one position Yeah, so that person is not going to commit to database because it takes time to creating and doing. So, see there is no new poison created No, we don't okay. So, long as you give the name this person, they notice the composure that means, you taste classic classes not going to commit anything to database and it cannot get any information from database also, it will try to put in it this class, it will not bring the information that I was delivering the information only from the test data.
But still, you still if you want to get information from the database, then you should use something called see all data is not a good practice to use. But if you see your data you can go here you to learn So, you have to read this and understand SEO a lot a tool that means that it is going to see all the data from the system, all the questions on the system, then run the batch, but it will not commit and commit anything. Exactly we will see all that true okay. But it is not good practice to use the sealer what you can use depending on something like which color you cannot create what you want that occurred and then you can use the sealer or you can patch it. Okay. So, I will send you one link of the testing, okay.
Like so limit is out there tells you say, yeah, we'll do this. And then you know, then maybe we'll do a little keeping the same, right? Yeah, sure. Okay. Thank you tomorrow. Yes, yeah.
I just joined I thought 630s like I forgot about the data. saving time. Okay, so I taught the class that just now. So will there be a class tomorrow? Yes, yes. Yes.
Okay. So one day you couldn't join you just misses me once, okay? Yeah, sure. Oh, okay. We'll be doing Raven. You can check this also.
Yes. Okay. Thank you.