This file contains 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 TestViewExtension | |
{ | |
public static string RenderViewUnderTest(this HtmlHelper helper, string controller, string action, object model) | |
{ | |
var ctx = new ViewDataDictionary(model); | |
helper.ViewContext.RouteData.Values["Controller"] = controller; | |
helper.ViewContext.RouteData.Values["Action"] = action; | |
var sw = new StringWriter(); | |
var viewContext = new ViewContext(helper.ViewContext, helper.ViewContext.View,ctx,helper.ViewContext.TempData, sw); |
This file contains 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
require 'System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | |
class ConfigurationSettingsHackery | |
def set_config_file(new_config_file) | |
set_config_file_on_current_app_domain(new_config_file) | |
refresh_current_client_config_paths | |
reset_configuration_manager_to_force_reload | |
end | |
This file contains 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 when_using_an_class_without_an_interface | |
{ | |
private static SansInterfaceConsumer consumer; | |
private Establish context = () => | |
{ | |
ObjectFactory.Initialize(x => | |
{ | |
x.ForConcreteType<SanInterfaceService>(); | |
x.ForConcreteType<SansInterfaceConsumer>(); |
This file contains 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 DialogElement | |
{ | |
readonly IWebDriver _driver; | |
readonly string _idSelector; | |
public DialogElement(IWebDriver driver, string idSelector) | |
{ | |
_driver = driver; | |
_idSelector = idSelector; | |
} |
This file contains 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 BasicFilter | |
{ | |
public Guid? ClientGroupId { get; set; } | |
[LikeQueryFilter(ComponentModel = typeof (Address))] | |
public string AddressCity { get; set; } | |
[QueryFilter(ComponentModel = typeof (Address))] | |
public string AddressState { get; set; } |
This file contains 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
// how I'm creating the processor factory | |
var processorFactory = ProcessorFactory.GetFactory(options.DatabaseType); | |
var processor = processorFactory.Create(_configuration.ConnectionString,announcer, new ProcessorOptions | |
{ | |
PreviewOnly = false, | |
Timeout = options.Timeout | |
}); | |
//executing the migrations | |
migration.ExecuteWith(migration_processor); |
This file contains 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; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Web; | |
using System.Xml.Serialization; | |
namespace MvcTraining.Services | |
{ | |
public interface IRepository<T> | |
{ |
This file contains 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 signForm = $.ajax({ | |
type: "POST", | |
url: "/some/form", | |
dataType: "JSON", | |
data: myData | |
}); | |
signForm.done(function(response){ | |
// handle success here | |
}); |
This file contains 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 root_url = "/api" | |
, templates = {} | |
, collection_templates = {} | |
, link_template | |
, resource_template | |
, resource_item_template | |
, resource_link_template | |
, form_field_template; | |
var get = function (url, callback) { |
This file contains 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
controls|actions[ | |
{ | |
name: "Edit", | |
Prompt: "Create Property" | |
href: | |
methods:["Post"] | |
}, | |
{ | |
name: "ChangeContract", | |
Prompt: "Create Property" |
OlderNewer