testdrivendesign

Repository pattern for database that allows CRUD operations through Interops

旧巷老猫 提交于 2019-12-25 09:48:59
问题 The situation we are facing currently is Model Entities and database logic are tightly interweaved together which is making unit tests impossible. So, I decided to go with designing a Repository pattern. The basic structure of storage model what we see through Com interactions Root-Children[each child is another Root]. It's a tree structure. Understanding this, the Repository we designed is RootRepository for CRUD operations on root and ChildRepository internal to RootRepository for CRUD

Where to start with test driven development?

断了今生、忘了曾经 提交于 2019-12-13 04:37:07
问题 I'm relatively new to Test Driven Development, and I was just wondering where I should start? I understand how to do the testing. I just mean what should I test first? Is there a best practice for this? Should I test the models first? The controllers? Should I write an integration test first thing, then build everything up from there to make it pass? What are the opinions on this? 回答1: I don't think there's one hard and fast answer on where to start. I personally like to start with my UI

The Purpose of Mocking

和自甴很熟 提交于 2019-11-30 05:42:42
What is the purpose of mocking? I have been following some ASP.NET MVC tutorials that use NUnit for testing and Moq for mocking. I am a little unclear about the mocking part of it though. The purpose of mocking is to isolate the class being tested from other classes. This is helpful when a class : connects to an external resource (FileSystem, DB, network ... ) is expensive to setup, or not yet available (hardware being developed) slows down the execution of the unit tests has a non-deterministic behavior has (or is) a user interface It also makes it easier to test for error conditions, as your

The Purpose of Mocking

喜你入骨 提交于 2019-11-29 03:50:07
问题 What is the purpose of mocking? I have been following some ASP.NET MVC tutorials that use NUnit for testing and Moq for mocking. I am a little unclear about the mocking part of it though. 回答1: The purpose of mocking is to isolate the class being tested from other classes. This is helpful when a class : connects to an external resource (FileSystem, DB, network ... ) is expensive to setup, or not yet available (hardware being developed) slows down the execution of the unit tests has a non

Unit Testing or Functional Testing? [closed]

拈花ヽ惹草 提交于 2019-11-28 16:24:05
I have recently heard of Functional Testing over Unit Testing. I understand that Unit Testing tests each of the possibilities of a given piece of code from its most atomic form. But what about Functional Testing? This sounds to me like only testing if the code works, but is it as reliable as Unit Testing? I've been told there was two school of thoughts for the matter. Certains would prefer Unit Testing, others Functional Testing. Is there any good resources, links, books, any references or one of you all who can explain and elighten my path on the subject? Thanks! Jason's answer is correct.

Unit Testing or Functional Testing? [closed]

落爺英雄遲暮 提交于 2019-11-27 09:52:17
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I have recently heard of Functional Testing over Unit Testing. I understand that Unit Testing tests each of the possibilities of a