示例#1
0
 static Tests()
 {
     VerifyDiffPlex.Initialize();
     VerifierSettings.DisableClipboard();
     VerifierSettings.ModifySerialization(
         settings => settings.IgnoreMember <Exception>(_ => _.StackTrace));
 }
示例#2
0
        public PlaidClientTest()
        {
            VerifierSettings.DisableClipboard();
            VerifierSettings.ScrubLinesContaining(StringComparison.OrdinalIgnoreCase, "RequestId");
            VerifierSettings.UseStrictJson();

            var configuration = new ConfigurationBuilder()
                                .AddEnvironmentVariables()
                                .AddJsonFile("secrets.json", optional: true)
                                .Build();
            var plaidOptions = configuration.GetSection(PlaidOptions.SectionKey).Get <PlaidOptions>();

            if (string.IsNullOrWhiteSpace(plaidOptions?.ClientId))
            {
                throw new InvalidOperationException("Please provide ClientId configuration via PLAID__CLIENTID environment variable or Plaid:ClientId in secrets.json.");
            }
            if (string.IsNullOrWhiteSpace(plaidOptions?.Secret))
            {
                throw new InvalidOperationException("Please provide Secret configuration via PLAID__SECRET or Plaid:Secret in secrets.json.");
            }
            if (string.IsNullOrWhiteSpace(plaidOptions?.DefaultAccessToken))
            {
                throw new InvalidOperationException("Please provide DefaultAccessToken configuration via PLAID__DEFAULTACCESSTOKEN or Plaid:DefaultAccessToken in secrets.json.");
            }

            PlaidClient = new PlaidClient(
                MOptions.Create(plaidOptions));
        }
示例#3
0
    void DisableClipboardGlobal()
    {
        #region DisableClipboardGlobal

        VerifierSettings.DisableClipboard();

        #endregion
    }
示例#4
0
        public Task ApproveApi(string frameworkVersion)
        {
            VerifierSettings.DisableClipboard();
            string codeBase            = Assembly.GetExecutingAssembly().Location;
            var    uri                 = new UriBuilder(new Uri(codeBase));
            string assemblyPath        = Uri.UnescapeDataString(uri.Path);
            var    containingDirectory = Path.GetDirectoryName(assemblyPath);
            var    configurationName   = new DirectoryInfo(containingDirectory).Parent.Name;
            var    assemblyFile        = Path.GetFullPath(
                Path.Combine(
                    GetSourceDirectory(),
                    Path.Combine("..", "..", "Src", "FluentAssertions", "bin", configurationName, frameworkVersion, "FluentAssertions.dll")));

            var assembly  = Assembly.LoadFile(Path.GetFullPath(assemblyFile));
            var publicApi = assembly.GeneratePublicApi(options: null);

            return(Verifier
                   .Verify(publicApi)
                   .UseDirectory(Path.Combine("ApprovedApi", "FluentAssertions"))
                   .UseStringComparer(OnlyIncludeChanges)
                   .UseFileName(frameworkVersion)
                   .DisableDiff());
        }
示例#5
0
 public static void Initialize()
 {
     Environment.SetEnvironmentVariable("DiffEngine_Disabled", "true");
     VerifierSettings.DisableClipboard();
     VerifyDiffPlex.Initialize();
 }
示例#6
0
 static DisableClipboardTests()
 {
     VerifierSettings.DisableClipboard();
     DiffRunner.Disabled = true;
 }