ILdapConnection still not mockable and testable
See original GitHub issueHi, I have found another problem that prevents testability of your library.
Types returned from methods in the ILdapConnection
interface, such as LdapResponseQueue
and others have only an internal constructor.
When creating a mock of ILdapConnection
for testing purposes it’s impossible to setup behaviour for such methods, as there’s no way to construct the returned type.
I am willing to work on this and send you a pull request if you agree to fix this.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Mocking Symfony Ldap::create for unit tests
The way I have developed this plugin is to allow configuration of a number of servers to which we will connect. If we...
Read more >Interfacing with hard-to-test third-party code
As you can see this interface is a lot simpler to mock and work with than the original one as a result it...
Read more >Design Through Testability - An Example
So I thought we'd walk through an example to see how making code testable (which doesn't necessarily mean testing it) can turn some...
Read more >Class MockableLDAPConnection
This class provides an implementation of an FullLDAPInterface that provides a basic means of mocking an LDAPConnection (which itself is not easily mockable...
Read more >Holy on Dev: Mocking out LDAP/JNDI in unit tests - Jakub Holý
When unit testing a class that queries an LDAP server using ... a mock LDAP access layer so that the unit test (remember,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you share a sample where can I see, how you were able to mock
LdapSearchResults
?+1 Currently trying to mock LdapSearchResults with much difficulty. *Edit: I am using version 2.3.8 (from nuget). I see LdapSearchResults implements IEnumerable in the newer version. Any plans to update the nuget package?