We are looking for a solution for running for running fast test on Dataobjects.Net entities.

Ideally we would like to use entities without ever hitting the databse in a test.

Do you have any tip on how to achieve this?

asked Jun 08 '18 at 10:22

olorin's gravatar image

olorin
358878792


One Answer:

Hello olorin,

Could you provide a general example of such test. Do you need just not saving data to a database or completely detached from database behavior?

answered Jun 19 '18 at 04:50

Alexey%20Kulakov's gravatar image

Alexey Kulakov
77225

Hello Alexey,

Example 1 : Let's say I have a persistent business object : an Order. This object has order lines (EntitySet) and lots of properties. I want to export this object to a XML file. I want to write a test verifying the export XML file has the expected content.

Example 2 : I want to verify my order changed status correctly based on complex business rules when it is ready to be prepared in the warehouse. For example some items may be stored in a different warehouse, so two packages must be prepared.

(Jun 21 '18 at 02:47) olorin olorin's gravatar image

With lots of entities, such a test takes: 30s (domain start time) + 1s to 1 minute by test. Based on our experience, if we could run the test completely in memory without any IO, it could run in under a second.

(Jun 21 '18 at 02:48) olorin olorin's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA