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
// New interface... | |
using System.Threading.Tasks; | |
public interface IAsyncSaver<T> | |
{ | |
Task<T> Save(T item); | |
} | |
// Old way... |
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; | |
using System.Collections.Generic; | |
using System.Data.Common; | |
using System.Data.Linq; | |
using System.Data.Linq.SqlClient; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Reflection; |
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
namespace ApprovalTests.Persistence.EntityFramework.Version6 | |
{ | |
using System; | |
using System.Data.Common; | |
using System.Data.Entity; | |
using System.Data.Entity.Core.EntityClient; | |
using System.Data.Entity.Core.Objects; | |
using System.Data.Entity.Infrastructure; | |
using System.Linq; | |
using System.Reflection; |
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.Net.Http; | |
using System.Text; | |
using System.Web.Http; | |
using ApprovalTests; | |
using ApprovalUtilities.Utilities; |
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 void VerifyLog(Action code) | |
{ | |
var memoryAppender = new MemoryAppender(); | |
BasicConfigurator.Configure(memoryAppender); | |
code.Invoke(); | |
var aggregate = memoryAppender.GetEvents().Aggregate( | |
string.Empty, | |
(s, @event) => s + Environment.NewLine + @event.RenderedMessage); | |
Approvals.Verify(aggregate); |
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
private static void VerifyConfig(string path, Action<Configuration> action) | |
{ | |
using (var t = new TempFile(Path.GetRandomFileName())) | |
{ | |
File.Copy(path, t.File.FullName, true); | |
var fileMap = new ExeConfigurationFileMap { ExeConfigFilename = t.File.FullName }; | |
var exeConfig = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None); | |
action.Invoke(exeConfig); | |
var config = File.ReadAllText(exeConfig.FilePath); | |
Approvals.Verify(config); |
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
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions | |
choco install VisualStudio2013Ultimate | |
choco install googlechrome | |
choco install sublimetext2 | |
choco install console2 | |
choco install sourcecodepro | |
choco install resharper | |
choco install stylecop | |
choco install git-credential-winstore |
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 async Task<string> CreateHash(Stream stream) | |
{ | |
byte[] b; | |
using (var ctx = new System.Security.Cryptography.SHA256Managed()) | |
{ | |
var input = await stream.ReadDataAsync(); | |
b = ctx.ComputeHash(input); | |
} |
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
//1) Starting code... | |
Color color; | |
if (branchLength == 10) { | |
color = PenColors.Greens.Lime; | |
} else if (branchLength == 20) { |
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
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions | |
choco install googlechrome | |
choco install sublimetext2 | |
choco install console2 | |
choco install sourcecodepro | |
choco install githubforwindows | |
choco install tortoisemerge | |
choco install pscx |
OlderNewer