try-catch-FAIL

Failure is inevitable

NAVIGATION - SEARCH

SpecsFor and SpecsFor.Mvc Updated!

Thanks to some nice pull requests by Gheorghe Bulicanu, both SpecsFor and SpecsFor.Mvc have been updated! SpecsFor 5.0.1 fixes the annoying issue regarding incompatibility with NUnit 3.0. The SpecsFor now correctly restricts to versions less than 3.0 (which isn't currently supported.) SpecsFor.Mvc 4.8.0 includes updated Selenium WebDriver support, which will work with the latest versions of Chrome and IE. Both packages are available on NuGet now. Thanks again, Gheorghe, for the pull requests!

Using SpecsFor.Mvc with Windows Authentication

Numerous people have requested that I put together a sample that illustrates how to use SpecsFor.Mvc with Windows Authentication.  Guess what’s in this post? More...

SpecsFor.Mvc 4.5.0 Released!

A new build of SpecsFor.Mvc is now available on NuGet!  This release was made possible by contributions from the community, so a big “Thank You!” goes out to henkeson and neuhoffm!  Their contributions added support for: Project configurations that have non-standard solution locations (just call Solution.Named() or pass in the path to your solution directly!) UrlShouldMapTo and UrlMapsTo are now case-insensitive by default, but you can change this behavior if you want! You can change the Output path, which makes it possible to use SpecsFor.Mvc with multiple web projects at once! BrowserDriver’s constructor is now public, so you can configure your own instance of BrowserDriver! Oh, and there’s an updated ReSharper templates package available, too, that works with ReSharper 9.1.    As usual, let me know if there are any problems!

SpecsFor.Mvc Updated (again!)

SpecsFor.Mvc 4.4.0 is now live!  This release includes improvements contributed by two very awesome individuals.  E-mail addresses containing a ‘+’ character now work correctly, and you can now wait for an element on a form to become visible using the fluent interface.  Read on to learn more about these changes! More...

SpecsFor.Mvc and SpecsFor<Web> Helpers updated!

There are two new releases on the SpecsFor front today.  First, thanks to Neuhoffm again, SpecsFor.Mvc now supports radio buttons properly.  You can “check” a radio button by string value or by using a strongly-typed value: SUT.FindFormFor<Task>() .Field(m => m.Title).SetValueTo("use radio buttons") //By string... .Field(m => m.Complete, "false").Click() .Submit(); SUT.FindFormFor<Task>() .Field(m => m.Title).SetValueTo("use radio buttons") .Field(m => m.Complete, true).Click() //Or by strongly-typed value! .Field(m => m.Priority, Priority.High).Click() .Submit(); You can check out this change in the 4.3.0 release. Next, there’s a preview release of SpecsFor<Web> Helpers out today.  It adds support for fake ControllerContext, and you can easily wire this up on your controller specs like so: public class when_initializing_the_SUT_with_a_fake_controller : SpecsFor<DummyController> { protected override void When() { this.UseFakeContextForController(); GetMockFor<IPrincipal>() .Setup(x => x.Identity.Name) .Returns("My test!"); } [Test] public void then_it_configures_the_fake_user_correctly() { SUT.User.ShouldNotBeNull(); SUT.User.Identity.Name.ShouldEqual("My test!"); } } Note that SpecsFor<Web> Helpers 1.5.0  is currently in pre-release form.  I nuked FakePrinciple and FakeIdentity as part of this change as they seemed unnecessary.  If anyone can make a strong argument for why they should be kept, let me know, otherwise, this change will become final later this week. As always, let me know if you run into any problems!

SpecsFor.Mvc 4.2.0 Released!

There’s a new build of SpecsFor.Mvc available on NuGet tonight!  This version adds support for navigating to controllers within areas that are decorated with the RouteAreaAttribute class.  Now you can do things like NavigateTo<TController>() against controllers that are in areas without using the MvcFuture’s ActionLinkAreaAttribute. My thanks go out to Neuhoffm for this improvement!

SpecsFor.Mvc 4.1.0 Released!

Hot on the heels of SpecsFor.Mvc 4.0 comes the 4.1.0 release!  This is a minor update, but it adds a very-useful capability. More...

SpecsFor.Mvc 4.0 Released!

The final build of SpecsFor.Mvc 4.0 is live on NuGet.  Here’s a recap of what’s changed. More...

SpecsFor.Mvc 4.0 Coming Soon!

Hot off the NuGet press, it’s the first preview release of SpecsFor.Mvc 4.0!   This release introduces more configurability, exposes more state for your tests to examine, and (hopefully) greatly improves the initial setup experience by removing a lot of frustration. More...

SpecsFor Releases!

I’ve been quietly shipping preview releases of new things for SpecsFor for the last couple of months.  It’s time to finally get these things promoted to “final” status and talk about them.  From better assertions to a whole new helper library, there’s a lot to talk about, so buckle up! More...