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 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 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
| @powershell -ExecutionPolicy unrestricted .\bootmq.ps1 |
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
| 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 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
| 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 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
| 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 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
| // New interface... | |
| using System.Threading.Tasks; | |
| public interface IAsyncSaver<T> | |
| { | |
| Task<T> Save(T item); | |
| } | |
| // Old way... |
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
| using System; | |
| using System.Diagnostics.Contracts; | |
| public struct NonNullable<T> where T : class | |
| { | |
| private readonly T data; | |
| public NonNullable(T data) | |
| { | |
| if (data == null) |
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 class StackTraceScrubber | |
| { | |
| public static string ScrubAnonymousIds(string source) | |
| { | |
| var regex = new Regex(@"\w+__\w+"); | |
| return regex.Replace(source, string.Empty); | |
| } | |
| public static string ScrubLineNumbers(string source) | |
| { |
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 IEnumerable<TMembers> EmptyIfNull<TMembers>(this IEnumerable<TMembers> source) | |
| { | |
| return source ?? Enumerable.Empty<TMembers>(); | |
| } |
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
| using System.Linq; | |
| using ApprovalTests.Core; | |
| namespace ApprovalTests.Reporters | |
| { | |
| public class AutoTestReporter : IEnvironmentAwareReporter | |
| { | |
| public static readonly AutoTestReporter INSTANCE = new AutoTestReporter(); | |
| public void Report(string approved, string received) |