Questions tagged [test-class]

66 questions
0
votes
1 answer

Why i can't add Approval record row into the CR ticket

This is a Apex Test Class code, what i have here is that this class will contain hardcode value to create submit the ticket for approval. I was wondering if i can get any guidance here since i can't really get from other place. Thank you for any…
Ren
  • 57
  • 2
  • 9
0
votes
1 answer

Scanner skips input in a for loop

So I have this code: public class Subjects { String name; int period; char grade; public void period() { System.out.println("I have " + this.name + " during period " + this.period + "."); } public void study() { if (this.grade…
0
votes
0 answers

Java Program not printing out all the values I specified

So in my homework for a Java course we had to modify a class and then write a tester class in Jgrasp, my tester class looks like this public class BankAccountTester { public static void main(String[]args){ BankAccount account = new…
0
votes
1 answer

need help on how to achieve 100% in the test class

I have been trying to write test class for 100% coverage. I have difficulty in understanding how to call the standard controller and call the parameterised constructor also set the page to the current page as the current page. On the account view…
0
votes
1 answer

Importing jar and a type is indirectly referenced from required .class file

I was searching for a jar file from internet and I got a java project which contains that jar file. Now when I copied that jar file to my project and included them in my libraries, I have an error in the line of package name. Copying the jar from…
HareshKannan
  • 83
  • 11
0
votes
1 answer

Creating a test Class for batch apex

I am having truble creating a test class for this particular class. If anyone could provide some code that would implement this I would be very grateful. Many thanks Class: global class TalentIntCustomerBatch implements Database.Batchable,…
Andrew Hoban
  • 5
  • 2
  • 6
0
votes
1 answer

Test Class Error Message "Invalid id: Test"

I have created a test class however when it runs I am getting the error message "System.StringException: Invalid id: Test" "Stack Trace Class.MatchReadyImageTest.MatchReadyImage: line 6, column 1" Is there something I have done wrong? Many…
Andrew Hoban
  • 5
  • 2
  • 6
0
votes
2 answers

Creating a test class for a Select Statement

I was wondering if you could help me. I am strugging to create a test class for the code below. Any help would be appreciated. Many thanks public class MatchReadyImage { public Match_Day_Check_List__c obj {get; set; } public…
Andrew Hoban
  • 5
  • 2
  • 6
0
votes
1 answer

Implementing a Test class

I was wondering if you could help me. I am strugging to create a test class for the code below. Any help would be appreciated. Many thanks public class ITCheckList { public List getITCheckList(){ return [SELECT…
Andrew Hoban
  • 5
  • 2
  • 6
0
votes
1 answer

List has no rows for assignment to SObject Test class error

i'm an Apex newbie Need help with Apex test class. The controller class works great but I cant find a way to replicate it into a test class without the error "List has no rows for assignment to SObject" Here is the actual controller class: public…
Rufus K.
  • 107
  • 1
  • 6
0
votes
1 answer

Record created in test class is not visible in controller

I am creating a test class for a controller and i dont know for what reason a record created for a object is not visible in a method in controller.That method is having a select query which is giving the blank output. If i run the same query in test…
Pranay
  • 13
  • 1
  • 6
0
votes
3 answers

Java Test Class Won't Compile

I have written four cooperating classes, one of which is called WorkStation: Here is the code for the WorkStation class. import java.util.ArrayList; public class WorkStation { /** * the pc */ private Hardware pc; /** *…
Sam
  • 11
  • 1
  • 2
0
votes
3 answers

Why create a testClass object

I am just trying to understand something. What is the point of a testClass (z1) object? The way I understand it is, it is a starting point for all of the other objects. I am really asking what this means, why/how dose a testClass require an…
user2292173
  • 27
  • 1
  • 1
  • 5
0
votes
0 answers

Error on a Trigger Test-Case Involving Person Accounts

The test below tests a trigger that inserts a record for a custom object called 'Disbursement Destination' that has a Master-Detail relationship with Account and a LookUp relationship with Case. Please note that my organization (unfortunately) uses…
jackerman09
  • 2,492
  • 5
  • 29
  • 46
-1
votes
1 answer

Test Classes in Java

I have an assignment that looks like this: Write a class called Animal with a default sound() method. Create child classes with the sound() method for the following animals:pig, sheep, duck, cow. Create another class called AnimalTest that reads…