Permalink
Browse files

Updated resource text resource

Now returns null if the key was not found
  • Loading branch information...
1 parent bb3b1f7 commit a369f56c2d6674d98fb35cb14ac7234b07c3bd43 @thecodejunkie thecodejunkie committed Jan 3, 2013
@@ -18,7 +18,7 @@ public void Should_Return_Null_If_No_Assembly_Found()
var context = new NancyContext();
//When
- var result = defaultTextResource["Greeting", context];
+ var result = defaultTextResource["Texts.Greeting", context];
//Then
result.ShouldBeNull();
@@ -50,8 +50,9 @@ select new
var components =
GetKeyComponents(key);
- var manager =
- this.resourceManagers[components.Item1];
+ var manager = this.resourceManagers.ContainsKey(components.Item1) ?
+ this.resourceManagers[components.Item1] :
+ null;
return (manager == null) ? null : manager.GetString(components.Item2, context.Culture);
}

0 comments on commit a369f56

Please sign in to comment.