c# - Thinking OO with TDD - Where to start? -
I am trying to improve my TDD / OO skills and every time I use TDD for the effect of the design
Here's my case / story:
Identify a subset of customers for a review, start a review for them and some Send the letter.
Now the memory of my muscles has already written a question window, in which a UI has been designed and then I have to write some code
I want to That should be the domain code focus and I want it under test.
So what is the easiest thing in this matter?
I think I want a list of my clients I already have a client object (CSLA-style), though it has a load of reliance which is difficult to break. I think I can have a client reviewed object and it tests that I get the exact number of reviews. There are several factors that I need to consider, so it does not seem simple. And yet how do I guess the fact that I have 10 out of 20 clients?
Can someone help me on my way?
here - I will close you with some tests:
Class IdentifyClientsDueForReview {Public Zero CanStartSearch () {var s = new ClientSearcher (); } Public Zero CanSearchClients () {var s = New Client Explorer (); Var r = s.Find (c => c.id == 1); Assert.IsNotNull (R); } Public Zero Finds10Clients () {var db = new MockDB (); // Clients who need review (Int i = 0; i & lt; 10; i ++) {db.Add (New Client () {Next review = DateTime; Today Substrate Day (i)}); } // Customers who do not need review (Int i = 0; i <10; i ++) {db.Add (New Client () {Next review = DateTime Today.AdWords (i)}) ; } Var s = New Client Search (DB); Var r = s.Find (c = & gt; c.NextReview & lt; = DateTime.Today); Extraordinary (10, R. number); }}
This is a Linq to Sql or similar backend ORM built in the mind - otherwise, you might find the find
method and some hard codes are FindBy & lt; Criteria & gt;
Methods
This should give you the client finder
category, which uses the interface to hit the database. Both the MockDB
and your RealDB
class will implement that interface.
Comments
Post a Comment