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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>AngularJS Tutorials</title> | |
<link rel="stylesheet" href="//cdn.jsdelivr.net/foundation/5.4.7/css/foundation.css"> | |
<style> | |
.highlight { | |
color:red; | |
background-color:yellow; | |
} |
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 DelegateCommand<T> : ICommand | |
{ | |
readonly Func<T, bool> canExecute = _ => true; | |
readonly Action<T> executeAction; | |
bool canExecuteCache; | |
public DelegateCommand(Action<T> executeAction, Func<T, bool> canExecute) | |
{ | |
this.executeAction = executeAction; |
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 abstract class DateTimeProvider | |
{ | |
public static DateTimeProvider Current = new DefaultDateTimeProvider(); | |
public abstract DateTime UtcNow { get; } | |
} | |
public class DefaultDateTimeProvider : DateTimeProvider | |
{ | |
public override DateTime UtcNow | |
{ |
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 void TestIndex() | |
{ | |
var memoryTarget = TestLoggingExtensions.SetupNLogMemoryTarget(); | |
var controller = new PollsController(); | |
controller.Index(); | |
Approvals.VerifyAll(memoryTarget.Logs.FilterOutMigrationLogs(), "log"); | |
} |
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 struct AllocatedLock : IDisposable | |
{ | |
private readonly object _toLock; | |
public AllocatedLock(object toLock) | |
{ | |
_toLock = toLock; | |
} | |
public void Dispose() |
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 Approvals | |
{ | |
public static void Verify(string text, [CallerFilePath] string callerFilePath = null, [CallerMemberName] string callerName = null) | |
{ | |
string approvedText = null; | |
string filePath = BuildApprovalFilePath(callerFilePath, callerName); | |
var approvedFilePath = filePath + ".approved.txt"; | |
var receivedFilePath = filePath + ".received.txt"; | |
if (File.Exists(approvedFilePath)) | |
{ |