Questions tagged [test-class]
66 questions
8
votes
4 answers
How can I use Moose with Test::Class?
I'm currently refactoring a test suite built up by a colleague and would like to use Test::Class[::Most] while doing so. As I started I figured out I could really use a couple of Moose roles to decouple code a little bit. However, it seems it's not…

Nikolai Prokoschenko
- 8,465
- 11
- 58
- 97
3
votes
2 answers
SQL Server UnitTest Execution Order
How to configure the order of execution of SQL Server Unit Tests?
So for example I have this structure
UnitTests -- Main Project
- FooSchema -- Test Class
- SprocFoo1 -- Individual Unit Tests / Test Methods
- SprocFoo2
…

Karlx Swanovski
- 2,869
- 9
- 34
- 67
3
votes
1 answer
Test Automation with Perl
I am working on building a test automation framework with Perl and Selenium for a web-application.
I am weighing the pros and cons (with respect to maintainability of tests) of using Test::Routine v/s Test::Class . If there are people who have…

Moez Hirani
- 141
- 1
- 2
- 8
2
votes
1 answer
Conditional behavior in TestCleanUp if test had failed
I have a TestClass. In my TestCleanUp function, I want to do conditional actions depending on wether the test had failed.
I could of course wrap each test with try-catch and add a flag which I can later query, but I was wondering if there is…

Mugen
- 8,301
- 10
- 62
- 140
2
votes
1 answer
Test method from base class not executed after a test method from derived class is executed
I have a test class Navigation and I have derived class LeadExTest that is derived from Navigation class. Both class are of [TestClass] type
Now i have a ordered test file, that has a few tests i need to be executed in the order i have shown…

Rahul Lodha
- 3,601
- 7
- 25
- 34
1
vote
0 answers
hide test method in child test class
I have two test classes where one inherits from the other, like this:
[TestClass]
public class TestClassBase
{
// does some actual testing (load file, call methods, do Asserts and such)
protected virtual DoTest(string fileName) { ... }
…

Kjara
- 2,504
- 15
- 42
1
vote
1 answer
How to get fixture value from test method declared within a unittest TestCase class?
My google search here only shows this most-related answer here; though I can only have my code working for test method BUT NOT with unittest TestCase class method.
My question is how to get fixture value from test method declared within a unittest…

Nam G VU
- 33,193
- 69
- 233
- 372
1
vote
0 answers
Salesforce Apex Test Class for an auto convert apex class. REceiving errors moving to production
I have an apex class that works how I want it in the sandbox. Trying to move it to production and need to write a test class. Used an example provided but I continue to get errors when running test that the lead was already converted. Need Help!…

Wendy Tanner
- 11
- 1
1
vote
1 answer
Trying to Test Custom Lead Conversion Class but getting 0% Code Coverage
I am Testing below Class i.e. for Converting Lead and i am trying to write Test Class for this but this test class is not covering even 1% of Code.
global class LeadConversion
{
Public Id leadId;
public…

SFDC_M
- 61
- 1
- 6
1
vote
1 answer
TensorFlow PR Curve Plugin: pr_curve_streaming_op
Has anyone figured out a way to use pr_curve_streaming_op for multiclass classification ?
I am trying to follow this demo and this demo. But so far I am getting bumped at the data collection stage itself. Its seems like I need to be able to collect…

MLNINJA
- 502
- 4
- 10
1
vote
1 answer
Testing with Community User, getNetworkId return null
@isTest
public static void TestEmptySearchQuery() {
User thisUser = [ select Id from User where Id = :UserInfo.getUserId() ];
System.runAs ( thisUser ) { // running as thisUser to Avoid Error: MIXED_DML_OPERATION
…

NITHESH K
- 128
- 2
- 9
1
vote
1 answer
Test class for public final static string
How to write a test class for a class containing public final static strings in salesforce?
I tried using system.assertequals
Doesnt seem to work properly.
@isTest
private class Test_TPET_Constants{
private static testMethod void test() {
…

Tanvi Mittal
- 11
- 3
1
vote
0 answers
Eclipse Junit cannot run my test class: it displays "invalid project specified" message
I am trying to run my test classes using Junit test class in Eclipse maven project.It works fine for some projects and after copying and changing the name of the project Junit fails to start while other part of my project is working well. I tried…

Hussen A
- 459
- 2
- 6
- 15
1
vote
0 answers
I have no idea what this test is looking for
assertEquals(Modifier.STATIC | Modifier.PRIVATE, d.getClass().getDeclaredField("TYPES").getModifiers());
I have a fixed array that I wrote as a field like this:
private String[] TYPES;
and I initialized it like this:
TYPES= new String[3];
…

Hannah
- 11
- 1
1
vote
1 answer
How to deploy a test database for DBIx Class
I have Mojolicious app with a test suite using Test::Class::Moose. Using DBIx::Class to interact with my database, is there a way to setup an in-memory database that I can add fixture data to?
I'd like to use an in memory database because it'll mean…

a7omiton
- 1,597
- 4
- 34
- 61