Skip to main content
Code Review

Return to Question

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Is it considered correct to create an interface for my domain object? If I want to write unit tests against services which return a domain object, or check the values of these objects (when they return a list of domain objects) I think it seems right, but this article this article seems to suggest I shouldn't.

Is it considered correct to create an interface for my domain object? If I want to write unit tests against services which return a domain object, or check the values of these objects (when they return a list of domain objects) I think it seems right, but this article seems to suggest I shouldn't.

Is it considered correct to create an interface for my domain object? If I want to write unit tests against services which return a domain object, or check the values of these objects (when they return a list of domain objects) I think it seems right, but this article seems to suggest I shouldn't.

added a question regarding interfaces on models
Source Link
askrich
  • 175
  • 6

Is it considered correct to create an interface for my domain object? If I want to write unit tests against services which return a domain object, or check the values of these objects (when they return a list of domain objects) I think it seems right, but this article seems to suggest I shouldn't.

Questions

Questions

Is it considered correct to create an interface for my domain object? If I want to write unit tests against services which return a domain object, or check the values of these objects (when they return a list of domain objects) I think it seems right, but this article seems to suggest I shouldn't.

Questions

Removed unneeded info
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

Introduction

Recently I have moved from an environment where I am not unit testing, into one where I need to.

I have been a developer for many years and get core development concepts, as well as unit testing ones such as DI/Ioc, Mocking etc. I also understand the values, importance of unit testing and writing good tests, as well as asking myself often: "What Would Roy Do?".

There are other posts talking about mocking the entire framework, but this to me feels overkill?. Is there a better way than creating hand-written substitutions for every single table and value within there?

Footnote

I'm wanting to make the tests as lean and independent as I can, so when new developers join the team it is easy and straightforward for them to pick up. As a result of this I have created this post, after searching around for similar questions and articles. I hope the question does not appear too broad, or not a good fit. I hope it will prove useful for others having a problem with this topic.

Introduction

Recently I have moved from an environment where I am not unit testing, into one where I need to.

I have been a developer for many years and get core development concepts, as well as unit testing ones such as DI/Ioc, Mocking etc. I also understand the values, importance of unit testing and writing good tests, as well as asking myself often: "What Would Roy Do?".

There are other posts talking about mocking the entire framework, but this to me feels overkill? Is there a better way than creating hand-written substitutions for every single table and value within there?

Footnote

I'm wanting to make the tests lean and independent as I can, so when new developers join the team it is easy and straightforward for them to pick up. As a result of this I have created this post, after searching around for similar questions and articles. I hope the question does not appear too broad, or not a good fit. I hope it will prove useful for others having a problem with this topic.

I have been a developer for many years and get core development concepts, as well as unit testing ones such as DI/Ioc, Mocking etc. I also understand the values, importance of unit testing and writing good tests, as well as asking myself often: "What Would Roy Do?".

There are other posts talking about mocking the entire framework, but this to me feels overkill. Is there a better way than creating hand-written substitutions for every single table and value within there?

I'm wanting to make the tests as lean and independent as I can, so when new developers join the team it is easy and straightforward for them to pick up.

Post Reopened by 200_success
change from "important" to "product"
Source Link
askrich
  • 175
  • 6
Loading
edited title
Link
askrich
  • 175
  • 6
Loading
Title change
Link
askrich
  • 175
  • 6
Loading
edited tags
Link
askrich
  • 175
  • 6
Loading
Post Closed as "Not suitable for this site" by 200_success
Source Link
askrich
  • 175
  • 6
Loading
lang-vb

AltStyle によって変換されたページ (->オリジナル) /