public async Task UseWireCrypt(FbWireCrypt wireCrypt) { if (!EnsureServerVersion(new Version(3, 0, 0, 0))) { return; } if (!EnsureServerType(FbServerType.Default)) { return; } var csb = BuildConnectionStringBuilder(ServerType, Compression, WireCrypt); csb.WireCrypt = wireCrypt; await using (var conn = new FbConnection(csb.ToString())) { await conn.OpenAsync(); const string Pattern = ":[^:]*C[^:]*$"; if (wireCrypt == FbWireCrypt.Enabled || wireCrypt == FbWireCrypt.Required) { StringAssert.IsMatch(Pattern, conn.ServerVersion); } else { StringAssert.DoesNotMatch(Pattern, conn.ServerVersion); } } }
public FbTestsBase(FbServerType serverType, bool compression, FbWireCrypt wireCrypt, bool insertTestData = true) { ServerType = serverType; Compression = compression; WireCrypt = wireCrypt; _insertTestData = insertTestData; }
protected bool EnsureWireCrypt(FbWireCrypt wireCrypt) { if (WireCrypt == wireCrypt) { return(true); } Assert.Inconclusive($"Not supported with this {nameof(FbWireCrypt)}."); return(false); }
public static void SetUp(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) { var item = Tuple.Create(serverType, compression, wireCrypt); if (!_initalized.Contains(item)) { var cs = FbTestsBase.BuildConnectionString(serverType, compression, wireCrypt); FbConnection.CreateDatabase(cs, PageSize, ForcedWrite, true); CreateTables(cs); CreateProcedures(cs); CreateTriggers(cs); _initalized.Add(item); } }
private static WireCryptOption FbWireCryptToWireCryptOption(FbWireCrypt wireCrypt) { switch (wireCrypt) { case FbWireCrypt.Disabled: return(WireCryptOption.Disabled); case FbWireCrypt.Enabled: return(WireCryptOption.Enabled); case FbWireCrypt.Required: return(WireCryptOption.Required); default: throw new ArgumentOutOfRangeException(nameof(wireCrypt), $"{nameof(wireCrypt)}={wireCrypt}"); } }
private FbWireCrypt GetWireCrypt(string keyword, FbWireCrypt defaultValue) { var key = GetKey(keyword); if (!TryGetValue(key, out var value)) { return(defaultValue); } switch (value) { case FbWireCrypt fbWireCrypt: return(fbWireCrypt); case string s when Enum.TryParse <FbWireCrypt>(s, true, out var enumResult): return(enumResult); default: return(Common.ConnectionString.GetWireCrypt(key, base.TryGetValue, defaultValue)); } }
public TrackerIssuesTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt) { }
public FbTimeZonesSupportTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt) { }
public FbLongNumericsSupportTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt) { }
public FbStoredProcedureCallsTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt) { }
public FbCommandTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt) { }
static TestFixtureData CreateTestFixtureData(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) { var result = new TestFixtureData(serverType, compression, wireCrypt); result.Properties.Set(nameof(FbTestsBase.ServerType), serverType.ToString()); result.Properties.Set(nameof(FbTestsBase.Compression), compression.ToString()); result.Properties.Set(nameof(FbTestsBase.WireCrypt), wireCrypt.ToString()); return(result); }
public FbDecFloat16SupportTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt) { }
public static string BuildServicesConnectionString(FbServerType serverType, bool compression, FbWireCrypt wireCrypt, bool includeDatabase) { return(BuildServicesConnectionStringBuilder(serverType, compression, wireCrypt, includeDatabase).ToString()); }
public static string Database(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) { return($"{DatabaseBase}_{serverType}_{compression}_{wireCrypt}.fdb"); }
public FbBatchCommandTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt, false) { _shouldTearDown = false; }
public static string BuildConnectionString(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) { return(BuildConnectionStringBuilder(serverType, compression, wireCrypt).ToString()); }
public FbExceptionTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt) { }
public FbImplicitTransactionTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt) { }
public FbParameterTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt) { }
public FbDataReaderTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt) { }
public static FbConnectionStringBuilder BuildConnectionStringBuilder(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) { var builder = new FbConnectionStringBuilder(); builder.UserID = FbTestsSetup.UserID; builder.Password = FbTestsSetup.Password; builder.DataSource = FbTestsSetup.DataSource; builder.Database = FbTestsSetup.Database(serverType, compression, wireCrypt); builder.Port = FbTestsSetup.Port; builder.Charset = FbTestsSetup.Charset; builder.Pooling = FbTestsSetup.Pooling; builder.ServerType = serverType; builder.Compression = compression; builder.WireCrypt = wireCrypt; return(builder); }
public FbRemoteEventTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt) { }
internal static FbWireCrypt GetWireCrypt(string key, TryGetValueDelegate tryGetValue, FbWireCrypt defaultValue = default) { return(tryGetValue(key, out var value) ? (FbWireCrypt)value : defaultValue); }
public FbBooleanSupportTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt) { _shouldTearDown = false; }
public FbInt128SupportTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt, false) { }
public static FbConnectionStringBuilder BuildServicesConnectionStringBuilder(FbServerType serverType, bool compression, FbWireCrypt wireCrypt, bool includeDatabase) { var builder = new FbConnectionStringBuilder(); builder.UserID = FbTestsSetup.UserID; builder.Password = FbTestsSetup.Password; builder.DataSource = FbTestsSetup.DataSource; if (includeDatabase) { builder.Database = FbTestsSetup.Database(serverType, compression, wireCrypt); } builder.ServerType = serverType; return(builder); }
public TransactionScopeTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) : base(serverType, compression, wireCrypt) { }