C# version of Auction Sniper ch. 14 using VS 2010 Beta/Resharper 5/Rhino Mocks

275 views
Skip to first unread message

gaddzeit

unread,
Jan 19, 2010, 4:07:58 PM1/19/10
to Growing Object-Oriented Software
Hi,

As part of working through the book, I have been building the code in
parallel in Java and C# (using VS 2010 Beta, Resharper and Rhino
Mocks.) I have just posted the source code for up to the end of
chapter 14 of the AuctionSniper app written in C# here:

http://github.com/dgadd/GOOS_sample_csharp

Below is the README I've included with the posting. Any feedback would
be appreciated.

Cheers,

David Gadd

README.txt for GOOS sample code in Visual Studio 2010
================================================

David Gadd
http://www.twitter.com/gaddzeit
Email: gadd...@yahoo.ca

This version of the sample code from #goos was written using:
* Visual Studio 2010 Beta 2.0
* Visual Studio's unit-testing framework
(I experienced NUnit compatability issues in VS 2010 Beta 2.0;
to use this code in Visual Studio 2008 with NUnit just retag the test
class/method attributes.)
* Reshaper Beta5 (helpful but not required to run code)
* Rhino Mocks version 3.6.0.0 (assume this reference will be broken;
you will need to re-reference to a local copy)

This version is complete as of the end of Chapter 14, with all
acceptance and unit tests passing.

While I used OpenServer for the Java version, for this version I
created a fake XMPP server (all method calls are similar/identical).

Instead of using WindowLicker for a full end-to-end acceptance test, I
am simply mocking the IPickerMainView interface
and verifying in RhinoMocks that the SniperStatus string property is
being set. To achieve this, the level of scope in
the end-to-end acceptance test is not identical to the Java code;
above the method calls to ApplicationRunner.cs
and FakeAuctionServer.cs I am setting RhinoMocks expectations on
_mockPickerMainView.

Other than that, I am using the more commonly-used conventions in C#
than in Java of:
* prefixing interface names with capital I
* underscore prefixing instance variables

If you have any questions feel free to tweet or email me.


Nat Pryce

unread,
Jan 19, 2010, 4:12:01 PM1/19/10
to growing-object-o...@googlegroups.com
Awesome! Thanks for sharing this.

--Nat

www.natpryce.com

gaddzeit

unread,
Jan 24, 2010, 8:12:33 PM1/24/10
to Growing Object-Oriented Software
Hi,

Please note that I have updated the C# port of AuctionSniper:
1) It now uses a WinFormLicker to observe behavior on the WinForm in
separate thread (instead of just mocking a view interface)
2) I have moved it back to Visual Studio 2008 so that the tests can be
run with NUnit / Resharper 4.5

All other changes are listed in the readme. The code is found here:

http://github.com/dgadd/GOOS_sample_csharp

This reflects the code as of the end of chapter 14. I hope to have
chapter 15 completed and posted in the next week.

David Gadd

On Jan 19, 1:12 pm, Nat Pryce <nat.pr...@gmail.com> wrote:
> Awesome! Thanks for sharing this.
>
> --Nat
>
> www.natpryce.com
>

> On 19 Jan 2010, at 21:07, gaddzeit <gaddz...@gmail.com> wrote:
>
> > Hi,
>
> > As part of working through the book, I have been building the code in
> > parallel in Java and C# (using VS 2010 Beta, Resharper and Rhino
> > Mocks.) I have just posted the source code for up to the end of
> > chapter 14 of the AuctionSniper app written in C# here:
>
> >http://github.com/dgadd/GOOS_sample_csharp
>
> > Below is the README I've included with the posting. Any feedback would
> > be appreciated.
>
> > Cheers,
>
> > David Gadd
>
> > README.txt for GOOS sample code in Visual Studio 2010
> > ================================================
>
> > David Gadd
> >http://www.twitter.com/gaddzeit

> > Email: gaddz...@yahoo.ca

Steve Freeman

unread,
Nov 27, 2012, 4:53:36 AM11/27/12
to growing-object-o...@googlegroups.com
+1

S.
Reply all
Reply to author
Forward
0 new messages