Skip to content

Instantly share code, notes, and snippets.

@jbogard
Created January 10, 2013 18:14
Show Gist options
  • Save jbogard/4504406 to your computer and use it in GitHub Desktop.
Save jbogard/4504406 to your computer and use it in GitHub Desktop.
Script
Script
1. Test Base Class
2. Unique, Identifiable Links
3. Encapsulate in our tests
4. Strongly-typed views
5. 1:1 View to ViewModel ratio
6. Strongly-typed edit view
7. Templated helpers
8. Expression-based element selectors
9. Fluent form builder
protected InputForm<T> Form<T>()
{
return new InputForm<T>(Browser, _factoryRegistry);
}
private static readonly InputTesterFactoryRegistry _factoryRegistry
= new InputTesterFactoryRegistry();
10. Identifiable pages
@Html.EmbedCurrentPage(ViewContext)
11. Verifying pages by identifier
Browser.VerifyPage<ConferenceController>(c => c.Index(0));
12. Locating display fields
@Html.DisplayFor(m => m.Sessions[i].SpeakerFirstName)
Show.cshtml
13. Contextual model-based identifiers
@model string
<span class="display-field" id="@ViewData.TemplateInfo.GetFullHtmlFieldId(ViewData.TemplateInfo.HtmlFieldPrefix)">@Model</span>
14. Deterministic output
Show the chrome version
15. Model-based assertions
Browser.AssertValue<ConferenceListModel[]>(
c => c[0].Name, "CodeMashFoo");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment