I hereby claim:
- I am NickJosevski on github.
- I am nickjosevski (https://keybase.io/nickjosevski) on keybase.
- I have a public key whose fingerprint is 10C1 1301 4FA9 EAD5 7752 A6A2 E52B 0ADD 1554 99B8
To claim this, I am signing this object:
public class FSharpOptionObjectMapper : IObjectMapper | |
{ | |
public object Map(ResolutionContext context, IMappingEngineRunner mapper) | |
{ | |
var sourceValue = ((dynamic) context.SourceValue); | |
return (sourceValue == null || OptionModule.IsNone(sourceValue)) ? null : sourceValue.Value; | |
} | |
public bool IsMatch(ResolutionContext context) |
I hereby claim:
To claim this, I am signing this object:
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Data; | |
using System.Windows.Documents; | |
using System.Windows.Input; | |
using System.Windows.Media; | |
using System.Windows.Media.Imaging; |
//I saw this and thought there was a simple way around subbing extension methods | |
//http://blogs.clariusconsulting.net/kzu/how-to-mock-extension-methods/ | |
//My choice of solution was to just refactor the IRepo interface | |
namespace NSubIssueTests | |
{ | |
[TestFixture] | |
public class ExtensionOnInterfaceTests | |
{ |
routes.MapRoute("Shortcuts", | |
"{whereToGo}", | |
new | |
{ | |
controller = "TheRouter", | |
action = "TryRoute" | |
}); | |
/// more info: http://blog.nick.josevski.com/2012/01/05/unit-testing-javascript-methods-that-contain-jquery-ajax-calls | |
test("check if methodUnderTest completes successfully (mockJax way)", function () { | |
// Arrange | |
var jsonText = '{"id": "123","fieldName": "mj-fbs", "data": "fbs-text"}', | |
fieldBeingSaved = $('<input name="mj-fbs" Text="fbs-text"></input>'), | |
busyImg = $('<img id="mj-fbs-loading" alt="should-get-replaced-by-success-method"></img>'); | |
$.mockjax({ |
void Main() | |
{ | |
//demonstrating linq to xml handing of namespaces, using the feedburner style on Scott Hanselman's blog. | |
var request = (System.Net.HttpWebRequest) System.Net.WebRequest.Create(@"http://feeds.feedburner.com/ScottHanselman"); | |
using (var response = request.GetResponse()) | |
{ | |
var xmlDoc = XDocument.Load(response.GetResponseStream()); | |
//just paste this code in LinqPad (having selected Language: C# Program) and try and fix it ;) | |
void Main() | |
{ | |
//demonstrating linq to xml handing of namespaces, using the feedburner style on Scott Hanselman's blog. | |
var request = (System.Net.HttpWebRequest) System.Net.WebRequest.Create(@"http://feeds.feedburner.com/ScottHanselman"); | |
//this works: | |
using (var response = request.GetResponse()) | |
{ |
$("#core").load(href, function () { | |
setupClicks(); | |
}); | |
function setupClicks() { | |
$("a").unbind("click", clickHandler); | |
$("a").on("click", clickHandler); | |
}; | |
/* --- vs --- */ |
window.MyView = Backbone.View.extend({ | |
initialize: -> | |
_.bindAll(this,'render') | |
this.template = window.JST["MyView"] | |
this.model.bind('change', this.render) | |
render: -> | |
$(this.el).html(this.template(this.model.toJSON())) | |
events: { |