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
| private void SetupFakeNancyCompleteCallback(NancyContext context) | |
| { | |
| A.CallTo(() => this.fakeEngine.HandleRequest(A<Request>.Ignored, A<Func<NancyContext, NancyContext>>.Ignored, A<Action<NancyContext>>.Ignored, A<Action<Exception>>.Ignored)) | |
| .Invokes((i => ((Action<NancyContext>)i.Arguments[2]).Invoke(context))); | |
| } |
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 static void RegisterBundles(BundleCollection bundles) | |
| { | |
| bundles.Add(new ScriptBundle("~/Scripts/jquery") | |
| .Include("~/assets/javascripts/vendors/jquery-{version}.js")); | |
| bundles.Add(new ScriptBundle("~/Scripts/app") | |
| .IncludeFromSprocketFile("~/assets/javascripts/main.js")); | |
| var templateBundle = new Bundle("~/Scripts/templates").IncludeDirectory("~/assets/templates", "*.html"); | |
| templateBundle.Transforms.Add(new HtmlBundleTransform()); |
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
| namespace NancySample.Backbone.Todos | |
| { | |
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Text; | |
| using Cassette; | |
| using Cassette.BundleProcessing; |
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
| // current implementation of JavaScriptHtmlTemplatePipeline | |
| (function(d) { | |
| var addTemplate = function(id, content) { | |
| var script = d.createElement('script'); | |
| script.type = 'text/html'; | |
| script.id = id; | |
| if (typeof script.textContent !== 'undefined') { | |
| script.textContent = content; | |
| } else { |
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
| if (string.IsNullOrWhiteSpace(context.ModulePath)) | |
| return null; | |
| if (viewName.StartsWith("~/")) | |
| return viewName.Substring(2); | |
| return string.Concat("Views/", context.ModulePath, "/", context.ModuleName, "/", viewName); |
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
| using CsQuery; | |
| using Nancy; | |
| using Nancy.Testing; | |
| using Should; | |
| using Xunit; | |
| public class UserModuleTest | |
| { | |
| [Fact] | |
| public void WhenUserNotFound() |
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
| using System.Net.Http; | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var client = new HttpClient(); | |
| var batchRequest = new HttpRequestMessage(HttpMethod.Post, "http://localhost:3440/api/batch"); |
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
| namespace FacebookApi | |
| { | |
| using System; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| public class FacebookApi | |
| { | |
| private Func<object, string> serializeJson; | |
| private static Func<object, string> defaultJsonSerializer; |
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
| namespace SimpleBlog | |
| { | |
| using System; | |
| using System.Collections.Generic; | |
| using AppFunc = System.Func<System.Collections.Generic.IDictionary<string, object>, System.Threading.Tasks.Task>; | |
| public class SimpleBlog | |
| { | |
| public static AppFunc App(ISimpleBlogService service) | |
| { |
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
| caspol -m -ag 1.3 -url "file://\\vmware-host\shared folders/projects/*" FullTrust |