wfleming801 (1) [Avatar] Offline
#1
hi. just bought the book. and tried to build the sample code downloaded from GitHub. Ran into some challenges that I overcame, and thought I'd share what I did to get things to build. I'm not sure this is ready for a pull request, but maybe it will help someone else. I have Visual Studio 2015 Community edition and didn't have the test tools installed (found the dll online-- not clear how legit it is so won't provide link for that yet, but I was required to reference that assembly -- see below)

1 - Is.StringContaining() has been deprecated in NUnit 3.x.x release, but can be replaced with Does.Contain()

Assert.That(mockWebService.MessageToWebService,
                            Does.Contain("fake exception"));


2 - ExpectedException syntax changed so I replaced the command with


[ExpectedException(typeof(ArgumentException), "Whatever text message from original code")]



3 - errors with
ExpectedExceptionAttribute
ExpectedMessage

Added Project Assembly reference to a copy of "Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll" and added

                using Microsoft.VisualStudio.TestTools.UnitTesting;        


(note the using reference is named different than assembly)

-- adding this assembly creates ambiguities that can be resolved with:

               

using Assert = NUnit.Framework.Assert;

using StringAssert = NUnit.Framework.StringAssert;