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 ContextRunner extends Runner { | |
static class SpecificationMethod { | |
Class<?> TestContainerType; | |
Description TestContainerDescription; | |
ContextSpecification ContextSpecification; | |
Description ContextSpecificationDescription; | |
Field ContextSpecificationField; | |
Method SpecificationMethod; | |
Description SpecificationDescription; | |
} |
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 RobolectricGuicyTestRunner extends RobolectricTestRunner { | |
public RobolectricGuicyTestRunner(Class testClass) throws InitializationError { | |
super(testClass, new File("./application").exists() ? new File("./application") : new File("./")); | |
} | |
@Override | |
protected Application createApplication() { | |
Application app = super.createApplication(); | |
Injector injector = RoboGuice.getInjector(Stage.PRODUCTION, app,new RoboModule(app), new RobolectricModule()); | |
return app; |
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
/*** | |
Copyright (c) 2009 CommonsWare, LLC | |
Licensed under the Apache License, Version 2.0 (the "License"); you may | |
not use this file except in compliance with the License. You may obtain | |
a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
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 MyModule extends AbstractModule { | |
@Override | |
void configure() { | |
bind(String.class).annotatedWith(UserAgent.class).to(UserAgentProvider.class); | |
} | |
} | |
public class MyComponent { | |
String userAgent; |
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 model = new | |
{ | |
Accounts = accounts.Select(x => x.ToExpando()), | |
TotalUsers = totalUsers, | |
Page = page, | |
}; | |
return View(model.ToExpando()); |
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
//---><8--------------------------- UI loads viewmodels and generates commands ---- | |
UI.Viewmodel = ViewModelStore.Query(UI.SomeParameters); | |
UI.HandleInput = GeneratedCommand => CommandStore.Add(GeneratedCommand); | |
//---><8--------------------------- Commands to events ----------------------------------------- | |
// This uses an iterator because a command should only be handled once | |
while(CommandStore.HasCommands) |
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 class Extensions | |
{ | |
public static TResult SafeInvoke<TModel, TResult>(this TModel model, Func<TModel, TResult> expression, TResult nullValue = default(TResult)) | |
{ | |
try | |
{ | |
return expression(model); | |
} | |
catch (NullReferenceException) | |
{ |
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
(function ($) { | |
/// <summary>JQuery plugin for handling cascading html select lists</summary> | |
/// <param name="$" type="jQuery">JQuery</param> | |
$.fn.cascadingSelect = function() { | |
this.each(function() { | |
var $e = $(this); | |
var $p = $($e.attr("data-ui-cascading-parent")); | |
$e.data('cascading-opts', $e.find("option:gt(0)")); |
OlderNewer