Comments (3)
Pull requests are welcome!
from nredisgraph.
So I've reviewed this question, and the companion pull request, and I have some observations.
In the example test provided above, it appears as if two questions are under consideration:
- Does the repository execute a graph query and get an expected response?
- Does the query that the repository sends to RedisGraph match the expected query that (I'm assuming) is defined in the repository?
The first area under test seems better suited to an integration test with appropriate test data. My thinking here stems from the structure of that part of the test. If you notice, it looks like the mocking framework is being exercised and not application logic. In this case, an integration test would allow you to validate that the graph query defined is syntactically correct and returns an expected result set which would obviate the need for the second area of the unit test (which is more of an assertion of the implementation rather than a test of logic).
With all of that said, I really appreciate your contribution but I don't think the suggested changes are appropriate for this library.
Cheers,
Tom
from nredisgraph.
I agree that this absolutely would work better as a low-level integration test - that would in fact be my normal way to test a repository like this. However, in this particular circumstance, that isn't an option. The particulars of the test aside, the fact that the library is not abstractable makes unit testing anything that uses it very difficult. So even if I wasn't going to test graph directly as I do in my example test, because I cannot inject/abstract RedisGraph (without wrapping it in my own adapter/factory, as I have done as a mitigating measure), the entire class becomes untestable, which is simply a bad architecture.
Ultimately, it's your choice, as it's your library/package and therefore your architecture. I appreciate the time you've spent looking at it.
from nredisgraph.
Related Issues (20)
- Production usage HOT 1
- Escaping query parameters HOT 2
- RedisGraph integer type is 64-bit signed integers
- How to specify the password used to connect? HOT 2
- Add support for GRAPH.RO_QUERY HOT 1
- Add support for GRAPH.CONFIG
- Add support for GRAPH.EXPLAIN
- Add support for GRAPH.LIST
- Add support for GRAPH.PROFILE
- Add support for GRAPH.SLOWLOG
- Add ability to provide command flags...
- Support casting a result value as a map. HOT 1
- Support for Geo points.
- Support for "timeout" argument on `GraphQuery` method. HOT 1
- CallProcedure deserialization is not working with Read-Only queries HOT 8
- Obsolete attribute for RedisGraph 2.1 HOT 1
- Support map as parameter HOT 2
- Handle backslashes in string parameters
- Need to support nested Records in the Result Set HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nredisgraph.