This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Given(@"i'm on the homepage")] | |
| [Given(@"on the homepage")] | |
| [Given(@"I have navigated to the homepage")] | |
| [When(@"i'm on the homepage")] | |
| public void HomePage() | |
| {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I.Enter("Some text").In("input[data-automationid='userNameField']"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Given this simple class | |
| public class Kid | |
| { | |
| public int Id { get; set; } | |
| public string Name { get; set; } | |
| public IList<Quote> Quotes { get; set; } | |
| } | |
| // Now I have to write this long-winding code | |
| private Kid GetKidWithQoutes(int kidId) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8" ?> | |
| <configuration> | |
| <configSections> | |
| <sectionGroup name="simpleData"> | |
| <section | |
| name="simpleDataConfiguration" | |
| type="Simple.Data.SimpleDataConfigurationSection, Simple.Data"/> | |
| </sectionGroup> | |
| </configSections> | |
| <simpleData> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Creating a testing browser with a default nancy bootstrapper | |
| // This sets the browser up in the default state using | |
| // all the default conventions, engines and locations etc. | |
| var browser = new Browser(new DefaultNancyBootstrapper();); | |
| // If you want to control the execution a bit more, use | |
| // the Nancy.Testing.ConfigurableBootstrapper. | |
| // Simplest way to do that is to supply a lambda expression | |
| // In this case I will configure the browser to just load |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void showing_the_complete_stack_testing_in_NancyTesting() | |
| { | |
| // Set up a browser to test MySimpleModule only | |
| var browser = new Browser(with => with.Module(new MySimpleModule())); | |
| // Perform a request, in this case a HTTP-GET to "/login" | |
| // with a query-string | |
| // But this can of course be any HTTP verb and you can send in | |
| // forms, raw body-stream etc. Later blog-posts on that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void simplest_get_test() | |
| { | |
| // Arrange | |
| var browser = new Browser(with => with.Module(new SimpleModule())); | |
| // Act | |
| var response = browser.Get("/"); | |
| // Assert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SimpleModule : NancyModule | |
| { | |
| public SimpleModule() | |
| { | |
| Get["/"] = p => { return HttpStatusCode.OK; }; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var browser = | |