You need to sign in to do that
Don't have an account?
Kanagaraj Arjunan 11
Need Code coverage for Json class
Hi All
I am trying to write test class for the below class but i couldn't achive this. Anyone have idea about it please explain me .
public class JSON2Apex {
public class Address_components {
public String long_name;
public String short_name;
public List<String> types;
}
public class Northeast {
public Double lat;
public Double lng;
}
public List<Results> results;
public String status;
public class Bounds {
public Northeast northeast;
public Northeast southwest;
}
public class Geometry {
public Bounds bounds;
public Northeast location;
public String location_type;
public Bounds viewport;
}
public class Results {
public List<Address_components> address_components;
public String formatted_address;
public Geometry geometry;
public Boolean partial_match;
public String place_id;
public List<String> types;
}
}
I am trying to write test class for the below class but i couldn't achive this. Anyone have idea about it please explain me .
public class JSON2Apex {
public class Address_components {
public String long_name;
public String short_name;
public List<String> types;
}
public class Northeast {
public Double lat;
public Double lng;
}
public List<Results> results;
public String status;
public class Bounds {
public Northeast northeast;
public Northeast southwest;
}
public class Geometry {
public Bounds bounds;
public Northeast location;
public String location_type;
public Bounds viewport;
}
public class Results {
public List<Address_components> address_components;
public String formatted_address;
public Geometry geometry;
public Boolean partial_match;
public String place_id;
public List<String> types;
}
}
If you do want to cover something, try adding blank constructors to your classes and call them using test methods.
=====
ps: If your question/problem is resolved/answered, please mark your post as 'Solved' so that community can benefit by resolved posts.