How do I unit test a WCF service?

后端 未结 3 1486
走了就别回头了
走了就别回头了 2021-02-05 09:49

We have a whole bunch of DLLs that give us access to our database and other applications and services.

We\'ve wrapped these DLLs with a thin WCF service layer which our

3条回答
  •  故里飘歌
    2021-02-05 10:32

    It depends on what the thin WCF service does. If it's really thin and there's no interesting code there, don't bother unit testing it. Don't be afraid to not unit test something if there's no real code there. If the test cannot be at least one level simpler then the code under the test, don't bother. If the code is dumb, the test will also be dumb. You don't want to have more dumb code to maintain.

    If you can have tests that go all the way to the db then great! It's even better. It's not a "true unit test?" Not a problem at all.

提交回复
热议问题