internal static Task RunOnVerifyMismatch(FilePair item, string?message) { if (handleOnVerifyMismatch == null) { return(Task.CompletedTask); } return(handleOnVerifyMismatch(item, message)); }
internal static Task RunOnFirstVerify(FilePair item) { if (handleOnFirstVerify == null) { return(Task.CompletedTask); } return(handleOnFirstVerify(item)); }
static async Task <EqualityResult> GetResult(VerifySettings settings, FilePair filePair, Target target) { if (target.IsString) { var builder = new StringBuilder(target.StringData); ApplyScrubbers.Apply(target.Extension, builder, settings); return(await Comparer.Text(filePair, builder.ToString(), settings)); } var stream = target.StreamData; #if NETSTANDARD2_0 || NETFRAMEWORK using (stream) #else await using (stream) #endif { stream.MoveToStart(); return(await Comparer.Streams(settings, stream, filePair)); } }
static async Task <EqualityResult> GetResult(VerifySettings settings, FilePair filePair, ConversionStream conversionStream) { if (conversionStream.IsData) { var builder = new StringBuilder(conversionStream.Data); ApplyScrubbers.Apply(builder, settings.instanceScrubbers); return(await Comparer.Text(filePair, builder.ToString(), settings)); } var stream = conversionStream.Stream; #if NETSTANDARD2_0 || NETFRAMEWORK using (stream) #else await using (stream) #endif { stream.MoveToStart(); return(await Comparer.Streams(settings, stream, filePair)); } }
static async Task <EqualityResult> GetResult(VerifySettings settings, FilePair filePair, ConversionStream conversionStream) { var stream = conversionStream.Stream; #if NETSTANDARD2_0 || NETFRAMEWORK using (stream) #else await using (stream) #endif { stream.MoveToStart(); if (!EmptyFiles.Extensions.IsText(conversionStream.Extension)) { return(await Comparer.Streams(settings, stream, filePair)); } var builder = await stream.ReadAsString(); ApplyScrubbers.Apply(builder, settings.instanceScrubbers); return(await Comparer.Text(filePair, builder, settings)); } }