On Fri, Apr 25, 2008 at 9:42 AM, David Crooks <[EMAIL PROTECTED]> wrote:
> On Friday, April 25, 2008 10:36 AM Alan Bourke wrote: > > >Sure, but I wouldn't write the whole damn thing just to work with a > test harness. > > The purpose of Test Driven Development (TDD) is to write the tests first > not the other way around. > > ------------------------- You take all the fun out of it. Our Builds won't without a test class. ;-> Not that your test is going to do more then validate that some form of data got to this layer. ;-> I went over the tests done in some of our newer projects with linq data access. Those tests are nothing more then base low level assumed functionality: [TestMethod] public void GetAddressesWithSortedByLastName() { Guid distributionListId = new Guid("00000000-0000-0000-0000-000000000000"); AddressSearchCriteria addressSearchCriteria = new AddressSearchCriteria(); addressSearchCriteria.PageInfo = new PageInfo(20, 1); ///////////// snip other setup code here //sort ascending addressSearchCriteria.LastName.SortCriteria = new SearchSortCriteria(1, SearchSortDirection.Ascending); AddressSearchResponse addressSearchResponse = this.addressbookServiceClient.GetAddresses(addressSearchCriteria); Assert.IsTrue(addressSearchResponse.TotalItemCount > 0, "Total item count was 0. Test assumes that there are at least 1 valid record in the Address table."); Address previousEntry = addressSearchResponse.Items[0]; foreach (Address currentEntry in addressSearchResponse.Items) { Assert.IsTrue(previousEntry.LastName.CompareTo(currentEntry.LastName) <= 0, "Results were not correctly sorted by last name ascending."); previousEntry = currentEntry; } so as you can see we test that the sort works, and then we do a flip on descending as well. this test project / class has 30 tests for use. Or each method is represented by at least one test and multiple for a variety of params / nulls -- Stephen Russell Sr. Production Systems Programmer Mimeo.com Memphis TN 901.246-0159 --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.