Skip to content

Instantly share code, notes, and snippets.

@i-e-b
Created March 27, 2012 13:18
Show Gist options
  • Save i-e-b/2215767 to your computer and use it in GitHub Desktop.
Save i-e-b/2215767 to your computer and use it in GitHub Desktop.
MSpec templates for ReSharper using my MSpec wrapper
[Subject("with $subject$")]
public class $subject_cls$ : /*Database*/ContextOf<object> {
Establish context = () => { $END$ };
}
#pragma warning disable 169 // ReSharper disable InconsistentNaming, CheckNamespace
using Machine.Specifications;
// Feature: (is the folder I'm in)
// Scenario: $scenario$
//
// Given: $a_context$
// When: $doing_something$
// Then it: $should_do_something$
namespace $scenario_u$ {
class When_$doing_something_u$ : with.$a_context_u$ {
Because of = () => { result = subject.DoSomething(); };
It $should_do_something_u$ = () => result.ShouldNotBeNull();
}
#region contexts
namespace with {
[Subject("with $a_context$")]
public abstract class $a_context_u$ : /*Database*/ContextAndResult</*subject type*/ object, /*result type*/ object> {
Establish context = () => {
subject = new object();
};
}
}
#endregion
}
protected static
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment