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
module.exports = { | |
'Create a paid listing': function(browser) { | |
browser | |
.init() | |
.waitForElementVisible('body', 1000) | |
// Code to navigate to payment form | |
// Stripe card | |
.waitForElementPresent('.e2e-card-number iframe', 10000) | |
.element('css selector', '.e2e-card-number iframe', el => { | |
browser |
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
<appSettings> | |
<add key="mySetting" value="Pain" /> | |
</appSettings> |
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 builder = new ConfigurationBuilder() | |
.SetBasePath(env.ContentRootPath) | |
.AddJsonFile(“config.json”, optional: true, reloadOnChange: true) | |
.AddJsonFile($”appsettings.{env.EnvironmentName}.json”, optional: true) | |
.AddEnvironmentVariables(); |
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 RegisterOptions(this ContainerBuilder builder) | |
{ | |
builder.RegisterGeneric(typeof(OptionsManager<>)) | |
.As(typeof(IOptions<>)) | |
.SingleInstance(); | |
builder.RegisterGeneric(typeof(OptionsMonitor<>)) | |
.As(typeof(IOptionsMonitor<>)) | |
.SingleInstance(); | |
builder.RegisterGeneric(typeof(OptionsSnapshot<>)) | |
.As(typeof(IOptionsSnapshot<>)) |
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 RegisterConfigurationOptions<TOptions>(this ContainerBuilder builder, IConfiguration config) where TOptions : class | |
{ | |
if (builder == null) | |
{ | |
throw new ArgumentNullException(nameof(builder)); | |
} | |
if (config == null) | |
{ | |
throw new ArgumentNullException(nameof(config)); |
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 HomeController : Controller | |
{ | |
private ApiOptions _apiOptions; | |
public HomeController(IOptions<ApiOptions> apiOptions) | |
{ | |
_apiOptions= apiOptions.Value; | |
} | |
public IActionResult Index() | |
{ | |
return Content($"Api Name = {_apiOptions.Name}"); |
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 Endpoint | |
{ | |
public string Name { get; set; } | |
public string Url { get; set; } | |
} |
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 Configure<TOptions>(this ContainerBuilder builder, Action<TOptions> configureOptions) where TOptions : class | |
{ | |
if (builder == null) | |
{ | |
throw new ArgumentNullException(nameof(builder)); | |
} | |
if (configureOptions == null) | |
{ | |
throw new ArgumentNullException(nameof(configureOptions)); | |
} |
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 configurationBuilder = new ConfigurationBuilder() | |
.SetBasePath(Path.Combine(HttpRuntime.AppDomainAppPath, "configs")) | |
.AddJsonFile("settings.json", optional: false); | |
var configuration = configurationBuilder.Build(); | |
var builder = new ContainerBuilder(); | |
builder.RegisterOptions(); | |
builder.RegisterConfigurationOptions<MailingOptions>(configuration.GetSection("mailing")); | |
builder.RegisterConfigurationOptions<FeedOptions>(configuration.GetSection("feed")); |
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 ApiOptions | |
{ | |
public string Name { get; set; } | |
public List<ApiEndpoint> Endpoints { get; set; } | |
} | |
public class ApiEndpoint | |
{ | |
public string Url { get; set; } | |
public bool RetryOnFailure { get; set; } | |
public List<ApiEvent> AvailableEvents { get; set; } |
NewerOlder