Problem This is wrapper for POP3, POP3_SSL, IMAP4, IMAP4_SSL, SMTP and SMTP_SSL classes which let them work through proxies. For […]
Tag: mocks
First time writing tests (Service Layer)
Problem Service class: package personal.progresscompaninon.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import […]
Mocking UserDefaults in Swift
Problem In my application, I am using UserDefaults to save some data. I also started writing tests for testing my […]
Mocking config data in JavaScript unit tests
Problem I’d really like someone to sanity check my approach for unit testing the summarise() function and mocking its dependencies. […]
Unit testing needs only optional methods of protocol in Swift
Problem I have a protocol which has quite more methods, it looks like: protocol MessageService { //configuration var fetchOfflineMessagesOnLogin: Bool […]
Possible fake testing with Rhino mock
Problem I’m new to Rhino mock and I would like to know if the test I did is not fake […]
PHPUnit test for a PaymentMethodRuleManager
Problem The following code snippet is about adding rules that filters Payment Methods listing to customer, for email we provide […]
Using a factory class for TextWriter than can be stubbed/mocked
Problem This is my factory class: /// <summary> /// Inject TextWriterFactory into the class you need to test /// In […]
Mockable adapters
Problem The inspiration for this question comes from a talk by IanCooper; in particular, this remark: Never mock somebody else’s […]
Testing an abstract class
Problem I started writing a set of tests for my SageContextBase class, which needs to be abstract because the client […]