fflib-apex-mocks
fflib-apex-mocks copied to clipboard
An Apex mocking framework for true unit testing in Salesforce, with Stub API support
Currently, `fflib_IDGenerator.generate(ContactHistory.SObjectType)` returns `null000000000000` for any xxxHistory object because getDescribe().getKeyPrefix() returns null for these SObjects Extend the class's `generate` method to look like this: public static Id generate(Schema.SObjectType sobjectType) {...
**Describe the bug** This repo used to have **jar** files but those are no longer available but README.md file still references those jar files.
@vazexqi mentioned in #91 the idea of supporting @NamespaceAccessible annotation in the framework. At the time, Apex did not support this annotation with interfaces. Now that the support is present...
I have service classes which are used on OnBefore events that don't return anything. They literally just pass info to a Domain,which also does not return anything, to update my...
Possibly more a question than a comment: since apex-mocks is intended for use in unit tests, why aren't all its classes marked as `@IsTest`? That way they wouldn't count towards...
public class fflib_MyList implements IList { List myList; public interface IList { void add(String value); String get(Integer index); void clear(); Boolean isEmpty(); } public fflib_MyList() { this(new List()); } private...
**use case:** Mocking `xxxHistorySelector` result records (e.g. `AccountHistory`, `CaseHistory`, `customObj__History`) fflib_IdGenerator.generate(AccountHistory.SObjectType); current behavior: null pointer exception PR: returns `017xxxxxxxxxxxxxxx` **Notes:** OpportunityHistory returns `008xxxxxxxxxxxxxxx` (as this object has a keyPrefix available...
Hey guys, I recently started working with apex-mocks and I love it. The only thing I didn't like and where it falls a bit short with regards to Mockito is...
the method `throwException` currently displays Expected n, Actual m -- Wanted by not invoked which can lead to head scratching when one tries to figure out why the `verify` fails....
When an fflib generated mock class implements an interface with equals/hashcode, there is an issue with recording calls to equals with an argument being an instance of such a mock...