lundi 25 juillet 2016

C# Unit Test: Retrieve Data from Repository

so I have to create a unit test for my data retrieve, the object i want to get is quite big. I have repositories with "GetbyId" (in there we have the retrieve of the dataobject and the mapping). I figured out it would be better to create 2 unit tests:

  1. retrieve of the dataobject
  2. mapping to my model

We already created some test examples and I am checking the entities with saved xmls of the test-entity, so we are quite flexible. My Problem is with the mapping, since my Model does have some Interfaces I can't serialize it and i dont want to hardcode each example solution (because they are quite a lot too)

Has anyone an idea how I can test the mapper better?

Ps: I know, I am quite the master of explaining things badly, sorry for that.

Aucun commentaire:

Enregistrer un commentaire