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
angular.module('passwordModule', []) | |
.controller('credentialsController', ['$scope', | |
function($scope) { | |
// Initialise the password as hello | |
$scope.credentials = { | |
password: 'hello' | |
}; | |
} | |
]) | |
.directive('passwordStrength', [ |
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
<div ng-app="passwordModule" ng-controller="credentialsController" class="container"> | |
<form name="form"> | |
<div class="form-group"> | |
<label for="password">Password</label> | |
<input type="text" name="password" id="password" ng-model="credentials.password" ng-model-options="{allowInvalid: true}" pattern-validator="((?=.*\d)(?=.*[A-Z])(?=.*\W).{8,8})" class="form-control" /> | |
</div> | |
<div class="form-group"> | |
<label>Password Strength</label> |
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 UnityConfig | |
{ | |
public static IUnityContainer RegisterComponents() | |
{ | |
var container = new UnityContainer(); | |
// Register all repository classes automatically | |
// Register all service classes automatically in the business layer | |
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
internal class MockBuilder<TBuilder, TMock> | |
where TBuilder : MockBuilder<TBuilder, TMock>, new() | |
where TMock : class, new() | |
{ | |
private IList<Action<TMock>> _buildSteps; | |
protected MockBuilder() | |
{ | |
_buildSteps = Enumerable.Empty<Action<TMock>>().ToList(); | |
} |
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
/// <summary> | |
/// This is used on mostly checkboxes that ensure that they are ticked such as terms and conditions. | |
/// </summary> | |
public class MustBeTrueAttribute : ValidationAttribute | |
{ | |
public override bool IsValid(object value) | |
{ | |
if (value == null) return false; | |
if (value.GetType() != typeof(bool)) return false; |
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 SessionLifetimeManager<T> : Microsoft.Practices.Unity.LifetimeManager | |
{ | |
private string key; | |
public SessionLifetimeManager() | |
{ | |
this.key = typeof(T).Name; | |
} | |
/// <summary> |
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 LoginPage{ | |
private IWebDriver _webDriver; | |
public LoginPage(IWebDriver webDriver){ | |
_webDriver = webDriver; | |
} | |
[FindsBy(How = How.Name, Using = "username")] | |
private IWebElement UsernameInputElement {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
public BookingEventStep WithLocation(string location) | |
{ | |
_webdriver.ScrollElementToMiddle(LocationInput); | |
LocationInput.FillText(location); | |
var wait = new WebDriverWait(_webdriver, TimeSpan.FromSeconds(10)); | |
wait.Until(ExpectedConditions.ElementToBeClickable(By.ClassName("pac-item"))); | |
LocationInput.SendKeys(Keys.ArrowDown); | |
LocationInput.SendKeys(Keys.ArrowDown); |
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.Linq; | |
using System.Web; | |
using System.Web.Http; | |
namespace TestFileUpload | |
{ | |
public class FileUploadController : ApiController |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "es6", | |
"module": "commonjs", | |
"outDir": "dist", | |
"sourceMap": true | |
}, | |
"files": [ | |
"./node_modules/@types/mocha/index.d.ts", | |
"./node_modules/@types/node/index.d.ts" |
OlderNewer