Esempio n. 1
0
 public static void Enable(bool captureLogs = true)
 {
     if (captureLogs)
     {
         LogCapture.Initialize();
     }
     VerifierSettings.ModifySerialization(settings =>
     {
         settings.IgnoreMember <TestableInvokeHandlerContext>(x => x.MessageHeaders);
         settings.IgnoreMember <TestableInvokeHandlerContext>(x => x.Headers);
         settings.IgnoreMember <TestableInvokeHandlerContext>(x => x.MessageId);
         settings.IgnoreMember <TestableInvokeHandlerContext>(x => x.MessageHandler);
         settings.IgnoreMember <TestableInvokeHandlerContext>(x => x.MessageBeingHandled);
         settings.IgnoreMember <TestableInvokeHandlerContext>(x => x.MessageMetadata);
         settings.IgnoreMember <IMessageProcessingContext>(x => x.ReplyToAddress);
         settings.IgnoreMember <TestableEndpointInstance>(x => x.EndpointStopped);
         settings.IgnoreMember <TestableOutgoingLogicalMessageContext>(x => x.RoutingStrategies);
         settings.IgnoreMember <TestableOutgoingPhysicalMessageContext>(x => x.RoutingStrategies);
         settings.IgnoreMember <TestableRoutingContext>(x => x.RoutingStrategies);
         settings.IgnoreInstance <ContextBag>(x => !ContextBagHelper.HasContent(x));
         settings.IgnoreMembersWithType <IBuilder>();
         settings.AddExtraSettings(serializerSettings =>
         {
             var converters = serializerSettings.Converters;
             converters.Add(new ContextBagConverter());
             converters.Add(new SendOptionsConverter());
             converters.Add(new ExtendableOptionsConverter());
             converters.Add(new UnsubscriptionConverter());
             converters.Add(new TimeoutMessageConverter());
             converters.Add(new MessageToHandlerMapConverter());
             converters.Add(new SubscriptionConverter());
             converters.Add(new OutgoingMessageConverter());
         });
     });
 }
Esempio n. 2
0
    public static void Init()
    {
        VerifierSettings.ModifySerialization(
            settings =>
        {
            settings.AddExtraSettings(x =>
            {
                x.Converters.Add(new ResultConverter());
                x.Converters.Add(new TimestampConverter());
            });
#if NET5_0
            settings.IgnoreMember <System.Net.Http.HttpRequestException>(x => x.StatusCode);
#endif
            settings.IgnoreMember <Result>(x => x.File);
            settings.IgnoreMembers(
                "StackTrace",
                "Content-Length",
                "TrailingHeaders",
                "X-Amzn-Trace-Id",
                "Set-Cookie",
                "Report-To",
                "Connection",
                "Server-Timing",
                "Content-Type",
                "NEL",
                "Accept-Ranges",
                "Age",
                "Server",
                "X-Client-IP",
                "Strict-Transport-Security",
                "X-Cache-Status",
                "X-Cache",
                "origin");
        });
    }
Esempio n. 3
0
 static Tests()
 {
     VerifyDiffPlex.Initialize();
     VerifierSettings.DisableClipboard();
     VerifierSettings.ModifySerialization(
         settings => settings.IgnoreMember <Exception>(_ => _.StackTrace));
 }
Esempio n. 4
0
    void DontIgnoreEmptyCollections()
    {
        #region DontIgnoreEmptyCollections

        VerifierSettings.ModifySerialization(_ => _.DontIgnoreEmptyCollections());

        #endregion
    }
Esempio n. 5
0
    void DontIgnoreFalse()
    {
        #region DontIgnoreFalse

        VerifierSettings.ModifySerialization(_ => _.DontIgnoreFalse());

        #endregion
    }
Esempio n. 6
0
 public static void Setup()
 {
     VerifierSettings.ModifySerialization(settings =>
     {
         settings.IgnoreMembersThatThrow(x => x.Message == "Cannot escape out of a Tree.");
         settings.IgnoreMember <Parts>(x => x.Sha);
     });
 }
Esempio n. 7
0
    void DontScrubDateTimes()
    {
        #region DontScrubDateTimes

        VerifierSettings.ModifySerialization(_ => _.DontScrubDateTimes());

        #endregion
    }
Esempio n. 8
0
 public static void Enable() =>
 VerifierSettings.ModifySerialization(settings =>
 {
     settings.AddExtraSettings(serializerSettings =>
     {
         var converters = serializerSettings.Converters;
         converters.Add(new SessionConverter());
         converters.Add(new LazyStringValueConverter());
     });
 });
Esempio n. 9
0
 public Task NumericIdScrubbingDisabledGlobal()
 {
     VerifierSettings.ModifySerialization(settings => settings.DontScrubNumericIds());
     return(Verifier.Verify(
                new
     {
         Id = 5,
         OtherId = 5,
         YetAnotherId = 4
     }));
 }
Esempio n. 10
0
 public Task NumericIdScrubbingDisabledGlobal()
 {
     VerifierSettings.ModifySerialization(settings => settings.DontScrubNumericIds());
     return(Verifier.Verify(
                new
     {
         Id = 5,
         OtherId = 5,
         YetAnotherId = 4,
         PossibleNullId = (int?)5,
         ActualNullId = (int?)null
     }));
 }
Esempio n. 11
0
 public static void Initialize()
 {
     VerifierSettings.ModifySerialization(settings =>
     {
         settings.AddExtraSettings(serializerSettings =>
         {
             var converters = serializerSettings.Converters;
             converters.Add(new ProcessResultConverter());
             converters.Add(new SnippetConverter());
         });
     });
     VerifierSettings.AddScrubber(Scrubber.Scrub);
 }
 public static void Initialize()
 {
     VerifierSettings.ModifySerialization(settings =>
     {
         settings.AddExtraSettings(serializerSettings =>
         {
             var converters = serializerSettings.Converters;
             converters.Add(new ProcessResultConverter());
             converters.Add(new SnippetConverter());
         });
         settings.IgnoreMember <Exception>(exception => exception.StackTrace);
     });
 }
    public static void Initialize()
    {
        VerifySqlServer.Enable();
        VerifierSettings.ModifySerialization(settings =>
        {
            settings.AddExtraSettings(serializerSettings =>
                                      serializerSettings.TypeNameHandling = TypeNameHandling.Objects);
        });
        SqlHelper.EnsureDatabaseExists(Connection.ConnectionString);
        using var sqlConnection = Connection.OpenConnection();
        var manager = new QueueManager("error", sqlConnection);

        manager.Create().Await();
    }
 public static void Initialize()
 {
     VerifierSettings.AddScrubber(x => x.RemoveLineSuffix("boundary="));
     VerifierSettings.ModifySerialization(settings =>
     {
         settings.IgnoreMember <ExecutionResult>(result => result.Perf);
         settings.IgnoreMember <ExecutionResult>(result => result.Document);
         settings.IgnoreMember <ExecutionResult>(result => result.Operation);
         settings.AddExtraSettings(serializerSettings =>
         {
             serializerSettings.Converters.Add(new AttachmentConverter());
             serializerSettings.Converters.Add(new QueryResultConverter());
         });
     });
 }
 public static void Initialize()
 {
     VerifierSettings.ModifySerialization(settings =>
     {
         settings.IgnoreMember <ExecutionResult>(result => result.Perf);
         settings.IgnoreMember <ExecutionResult>(result => result.Document);
         settings.IgnoreMember <ExecutionResult>(result => result.Operation);
         settings.AddExtraSettings(serializerSettings =>
         {
             serializerSettings.Converters.Add(new OutgoingConverter());
             serializerSettings.Converters.Add(new AttachmentStreamConverter());
             serializerSettings.Converters.Add(new OutgoingAttachmentsConverter());
         });
     });
 }
    public static void Initialize()
    {
        VerifyImageMagick.RegisterComparers(.01);

        VerifierSettings.ModifySerialization(settings =>
        {
            settings.IgnoreMembers(
                "traceparent",
                "Traceparent",
                "X-Amzn-Trace-Id",
                "origin",
                "Content-Length",
                "TrailingHeaders");
        });
    }
Esempio n. 17
0
 public static void Initialize()
 {
     XunitContext.Init();
     LocalDbLogging.EnableVerbose();
     LocalDbSettings.ConnectionBuilder((instance, database) => $"Data Source=(LocalDb)\\{instance};Database={database};Pooling=true;Connection Timeout=300");
     VerifierSettings.ScrubLinesContaining("filename = '");
     VerifierSettings.ModifySerialization(settings =>
     {
         settings.IgnoreMember <LocalDbInstanceInfo>(x => x.OwnerSID);
         settings.IgnoreMember <LocalDbInstanceInfo>(x => x.Connection);
         settings.IgnoreMember <LocalDbInstanceInfo>(x => x.LastStartUtc);
         settings.IgnoreMember <LocalDbInstanceInfo>(x => x.Build);
         settings.IgnoreMember <LocalDbInstanceInfo>(x => x.Major);
         settings.IgnoreMember <LocalDbInstanceInfo>(x => x.Minor);
         settings.IgnoreMember <LocalDbInstanceInfo>(x => x.Revision);
     });
 }
Esempio n. 18
0
 public static void Init()
 {
     VerifierSettings.ModifySerialization(
         settings => settings.MemberConverter <Breadcrumb, IReadOnlyDictionary <string, string> >(
             target => target.Data,
             (_, value) =>
     {
         var dictionary = new Dictionary <string, string>();
         foreach (var pair in value)
         {
             if (pair.Key == "stackTrace")
             {
                 dictionary[pair.Key] = Scrubbers.ScrubStackTrace(pair.Value, true);
             }
             else
             {
                 dictionary[pair.Key] = pair.Value.Replace('\\', '/');
             }
         }
         return(dictionary);
     }));
 }
Esempio n. 19
0
    public static void Initialize()
    {
        var nsbVersion       = FileVersionInfo.GetVersionInfo(typeof(Endpoint).Assembly.Location);
        var nsbVersionString = $"{nsbVersion.FileMajorPart}.{nsbVersion.FileMinorPart}.{nsbVersion.FileBuildPart}";

        VerifierSettings.ScrubLinesContaining("StackTraceString");
        VerifierSettings.ScrubLinesContaining("NServiceBus.TimeSent");
        VerifierSettings.ScrubLinesContaining("HandlerStartTime");
        VerifierSettings.ScrubLinesContaining("HandlerFailureTime");
        VerifierSettings.AddScrubber(x => x.Replace(nsbVersionString, "NsbVersion"));
        VerifierSettings.ScrubMachineName();
        VerifierSettings.ModifySerialization(settings =>
        {
            settings.AddExtraSettings(newtonsoft =>
            {
                newtonsoft.Converters.Add(new LogEventPropertyConverter());
                newtonsoft.Converters.Add(new LogEventConverter());
                newtonsoft.Converters.Add(new ScalarValueConverter());
            });
        });
        VerifierSettings.AddExtraDatetimeFormat("yyyy-MM-dd HH:mm:ss:ffffff Z");
    }
Esempio n. 20
0
 void ScrubInlineGuids()
 {
     #region ScrubInlineGuids
     VerifierSettings.ModifySerialization(_ => _.ScrubInlineGuids());
     #endregion
 }