Пример #1
0
        public BaseManager()
        {
            _pbconnectionisvalid = false;
            _fbconnectionisvalid = false;

            if (Settings.Default.ServerType == FbServerType.Embedded.ToString())
            {
                _servertype = FbServerType.Embedded;
            }
            else
            {
                _servertype = FbServerType.Default;
            }

            _serverip  = Settings.Default.ServerIP;
            _pdatabase = Settings.Default.pBaseAlias;
            _fdatabase = Settings.Default.fBaseAlias;

            string pconnstring = pConnectionString();
            string fconnstring = fConnectionString();

            if (_pbconnectionisvalid == true & _fbconnectionisvalid == true)
            {
                _ge = new pBaseEntities(pconnstring);
                _fe = new fBaseEntities(fconnstring);
            }
            else
            {
                _ge = null;
                _fe = null;
            }
        }
 public FbTestsBase(FbServerType serverType, bool compression, FbWireCrypt wireCrypt, bool insertTestData = true)
 {
     ServerType      = serverType;
     Compression     = compression;
     WireCrypt       = wireCrypt;
     _insertTestData = insertTestData;
 }
Пример #3
0
        private FbServerType GetServerType(string keyword, FbServerType defaultValue)
        {
            object value;

            if (!TryGetValue(GetKey(keyword), out value))
            {
                return(defaultValue);
            }

            if (value is FbServerType)
            {
                return((FbServerType)value);
            }
            else if (value is string)
            {
                switch ((string)value)
                {
                case "Default":
                    return(FbServerType.Default);

                case "Embedded":
                    return(FbServerType.Embedded);
                }
            }

            return((FbServerType)GetInt32(keyword, (int)defaultValue));
        }
Пример #4
0
        public BaseManager()
        {
            _pbconnectionisvalid = false;
            _fbconnectionisvalid = false;

            if (Settings.Default.ServerType == FbServerType.Embedded.ToString())
            {
                _servertype = FbServerType.Embedded;
            }
            else
            {
                _servertype = FbServerType.Default;
            }

            _serverip = Settings.Default.ServerIP;
            _pdatabase = Settings.Default.pBaseAlias;
            _fdatabase = Settings.Default.fBaseAlias;

            string pconnstring = pConnectionString();
            string fconnstring = fConnectionString();

            if (_pbconnectionisvalid == true & _fbconnectionisvalid == true)
            {
                _ge = new pBaseEntities(pconnstring);
                _fe = new fBaseEntities(fconnstring);
            }
            else
            {
                _ge = null;
                _fe = null;
            }
        }
Пример #5
0
 public CalorimeterDatabase(FbServerType type = FbServerType.Default) : base(type)
 {
     UserSet          = new UserDataSet(connect, null, null);
     CalibratorSet    = new CalibratorDataSet(connect, null, null);
     CalibratorRowSet = new CalibratorRowDataSet(connect, null, null);
     CalibPointSet    = new CalibPointDataSet(connect, null, null);
 }
Пример #6
0
 public static void SetUp(FbServerType serverType)
 {
     if (!_initalized.Contains(serverType))
     {
         Prepare(serverType);
         _initalized.Add(serverType);
     }
 }
		public static void SetUp(FbServerType serverType)
		{
			if (!_initalized.Contains(serverType))
			{
				Prepare(serverType);
				_initalized.Add(serverType);
			}
		}
		private static void Prepare(FbServerType serverType)
		{
			string cs = TestsBase.BuildConnectionString(serverType);
			CreateDatabase(cs);
			CreateTables(cs);
			CreateProcedures(cs);
			CreateTriggers(cs);
		}
Пример #9
0
    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);
    }
Пример #10
0
        private static void Prepare(FbServerType serverType, bool compression)
        {
            string cs = TestsBase.BuildConnectionString(serverType, compression);

            CreateDatabase(cs);
            CreateTables(cs);
            CreateProcedures(cs);
            CreateTriggers(cs);
        }
 protected bool EnsureServerType(FbServerType type)
 {
     if (FbServerType == type)
     {
         return(true);
     }
     Assert.Inconclusive("Not supported on this server type.");
     return(false);
 }
 protected bool EnsureServerType(FbServerType serverType)
 {
     if (ServerType == serverType)
     {
         return(true);
     }
     Assert.Inconclusive($"Not supported on this {nameof(FbServerType)}.");
     return(false);
 }
Пример #13
0
        public static void SetUp(FbServerType serverType, bool compression)
        {
            var item = Tuple.Create(serverType, compression);

            if (!_initalized.Contains(item))
            {
                Prepare(serverType, compression);
                _initalized.Add(item);
            }
        }
Пример #14
0
        public static string BuildServicesConnectionString(FbServerType serverType, bool compression, bool includeDatabase)
        {
            FbConnectionStringBuilder cs = new FbConnectionStringBuilder();

            cs.UserID     = FbTestsSetup.UserID;
            cs.Password   = FbTestsSetup.Password;
            cs.DataSource = FbTestsSetup.DataSource;
            if (includeDatabase)
            {
                cs.Database = FbTestsSetup.Database(serverType, compression);
            }
            cs.ServerType = serverType;
            return(cs.ToString());
        }
Пример #15
0
    public static void SetUp(FbServerType serverType, bool compression)
    {
        var item = Tuple.Create(serverType, compression);

        if (!_initalized.Contains(item))
        {
            var cs = FbTestsBase.BuildConnectionString(serverType, compression);
            FbConnection.CreateDatabase(cs, PageSize, ForcedWrite, true);
            CreateTables(cs);
            CreateProcedures(cs);
            CreateTriggers(cs);
            _initalized.Add(item);
        }
    }
Пример #16
0
        public static FbConnectionStringBuilder BuildConnectionStringBuilder(FbServerType serverType)
        {
            FbConnectionStringBuilder cs = new FbConnectionStringBuilder();

            cs.UserID     = TestsSetup.UserID;
            cs.Password   = TestsSetup.Password;
            cs.DataSource = TestsSetup.DataSource;
            cs.Database   = TestsSetup.Database;
            cs.Port       = TestsSetup.Port;
            cs.Charset    = TestsSetup.Charset;
            cs.Pooling    = TestsSetup.Pooling;
            cs.ServerType = serverType;
            return(cs);
        }
        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);
        }
Пример #18
0
        public static FbConnectionStringBuilder BuildConnectionStringBuilder(FbServerType serverType, bool compression)
        {
            FbConnectionStringBuilder cs = new FbConnectionStringBuilder();

            cs.UserID      = FbTestsSetup.UserID;
            cs.Password    = FbTestsSetup.Password;
            cs.DataSource  = FbTestsSetup.DataSource;
            cs.Database    = FbTestsSetup.Database(serverType, compression);
            cs.Port        = FbTestsSetup.Port;
            cs.Charset     = FbTestsSetup.Charset;
            cs.Pooling     = FbTestsSetup.Pooling;
            cs.Compression = compression;
            cs.ServerType  = serverType;
            return(cs);
        }
Пример #19
0
        public static FbConnectionStringBuilder BuildConnectionStringBuilder(FbServerType serverType, bool compression)
        {
            var builder = new FbConnectionStringBuilder();

            builder.UserID      = FbTestsSetup.UserID;
            builder.Password    = FbTestsSetup.Password;
            builder.DataSource  = FbTestsSetup.DataSource;
            builder.Database    = FbTestsSetup.Database(serverType, compression);
            builder.Port        = FbTestsSetup.Port;
            builder.Charset     = FbTestsSetup.Charset;
            builder.Pooling     = FbTestsSetup.Pooling;
            builder.Compression = compression;
            builder.ServerType  = serverType;
            return(builder);
        }
Пример #20
0
    private FbServerType GetServerType(string keyword, FbServerType defaultValue)
    {
        var key = GetKey(keyword);

        if (!TryGetValue(key, out var value))
        {
            return(defaultValue);
        }
        switch (value)
        {
        case FbServerType fbServerType:
            return(fbServerType);

        case string s when Enum.TryParse <FbServerType>(s, true, out var enumResult):
            return(enumResult);

        default:
            return(Common.ConnectionString.GetServerType(key, base.TryGetValue, defaultValue));
        }
    }
Пример #21
0
        //----------------------------------------------------------------------
        public UlFirebird(FbServerType type = FbServerType.Default)
        {
            connect             = new FbConnection();
            connectStrings      = new FbConnectionStringBuilder();
            command             = new FbCommand("", connect);
            command.Transaction = null;
            dataAdapter         = new FbDataAdapter("", connect);
            trans = null;

            connectStrings.Clear();
            connectStrings.DataSource = "";
            connectStrings.Database   = "";
            connectStrings.UserID     = "SYSDBA";
            connectStrings.Password   = "******";
            connectStrings.Charset    = "NONE";
            connectStrings.Dialect    = 3;
            connectStrings.Port       = 3050;
            connectStrings.Pooling    = false;
            connectStrings.ServerType = type;
        }
Пример #22
0
        private FbServerType GetServerType(string keyword, FbServerType defaultValue)
        {
            if (!TryGetValue(GetKey(keyword), out var value))
            {
                return(defaultValue);
            }

            switch (value)
            {
            case FbServerType fbServerType:
                return(fbServerType);

            case string s when s == "Default":
                return(FbServerType.Default);

            case string s when s == "Embedded":
                return(FbServerType.Embedded);

            default:
                return((FbServerType)GetInt32(keyword, (int)defaultValue));
            }
        }
 public FbDatabaseInfoTests(FbServerType serverType)
     : base(serverType, false)
 {
 }
 public FbCommandTests(FbServerType serverType, bool compression)
     : base(serverType, compression)
 {
 }
Пример #25
0
 public GuidTests(FbServerType serverType)
     : base(serverType, false)
 {
 }
 public FbConnectionTests(FbServerType serverType)
     : base(serverType, false)
 {
 }
 public FbDataReaderTests(FbServerType serverType)
     : base(serverType, false)
 {
 }
		public static string BuildServicesConnectionString(FbServerType serverType)
		{
			return BuildServicesConnectionString(serverType, true);
		}
Пример #29
0
 public FbBlobTests(FbServerType serverType)
     : base(serverType)
 {
 }
		private static void Drop(FbServerType serverType)
		{
			string cs = TestsBase.BuildConnectionString(serverType);
			DropDatabase(cs);
		}
		public FbScriptTests(FbServerType serverType)
 			: base(serverType)
		{
		}
		public TestsBase(FbServerType serverType, bool withTransaction)
		{
			_fbServerType = serverType;
			_withTransaction = withTransaction;
		}
		public FbDatabaseSchemaTests(FbServerType serverType)
			: base(serverType, false)
		{
		}
		public TestsBase(FbServerType serverType)
			: this(serverType, false)
		{
		}
		public static FbConnectionStringBuilder BuildConnectionStringBuilder(FbServerType serverType)
		{
			FbConnectionStringBuilder cs = new FbConnectionStringBuilder();

			cs.UserID = TestsSetup.UserID;
			cs.Password = TestsSetup.Password;
			cs.DataSource = TestsSetup.DataSource;
			cs.Database = TestsSetup.Database;
			cs.Port = TestsSetup.Port;
			cs.Charset = TestsSetup.Charset;
			cs.Pooling = TestsSetup.Pooling;
			cs.ServerType = serverType;
			return cs;
		}
		public static string BuildServicesConnectionString(FbServerType serverType, bool includeDatabase)
		{
			FbConnectionStringBuilder cs = new FbConnectionStringBuilder();

			cs.UserID = TestsSetup.UserID;
			cs.Password = TestsSetup.Password;
			cs.DataSource = TestsSetup.DataSource;
			if (includeDatabase)
			{
				cs.Database = TestsSetup.Database;
			}
			cs.ServerType = serverType;

			return cs.ToString();
		}
 public FbImplicitTransactionTests(FbServerType serverType, bool compression)
     : base(serverType, compression)
 {
 }
 public FbDataReaderTests(FbServerType serverType)
     : base(serverType, false)
 {
 }
		public TransactionScopeTests(FbServerType serverType)
			: base(serverType)
		{
		}
		public static string BuildConnectionString(FbServerType serverType)
		{
			return BuildConnectionStringBuilder(serverType).ToString();
		}
		public FbDataAdapterTests(FbServerType serverType)
			: base(serverType, false)
		{
		}
Пример #42
0
 public TestsBase(FbServerType serverType, bool withTransaction)
 {
     this.fbServerType = serverType;
     this.withTransaction = withTransaction;
 }
		public TrackerIssuesTests(FbServerType serverType)
			: base(serverType, false)
		{
		}
 public FbConnectionTests(FbServerType serverType)
     : base(serverType, false)
 {
 }
Пример #45
0
 public FbArrayTests(FbServerType serverType)
     : base(serverType, true)
 {
 }
		public FbStoredProcCallsTests(FbServerType serverType)
			: base(serverType, false)
		{
		}
 public FbImplicitTransactionTests(FbServerType serverType)
     : base(serverType)
 {
 }
Пример #48
0
 public FbBlobTests(FbServerType serverType)
     : base(serverType, false)
 {
 }
Пример #49
0
 public FbBooleanSupportTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt)
     : base(serverType, compression, wireCrypt)
 {
     _shouldTearDown = false;
 }
		public FbCommandTests(FbServerType serverType)
			: base(serverType, false)
		{
		}
Пример #51
0
 public FbConnectionTests(FbServerType serverType, bool compression)
     : base(serverType, compression)
 {
 }
 public FbTransactionTests(FbServerType serverType)
     : base(serverType, false)
 {
 }
Пример #53
0
 public FbDatabaseSchemaTests(FbServerType serverType)
     : base(serverType, false)
 {
 }
 public FbExceptionTests(FbServerType serverType)
     : base(serverType)
 {
 }
 public FbDecFloat16SupportTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt)
     : base(serverType, compression, wireCrypt)
 {
 }
 public FbParameterTests(FbServerType serverType)
     : base(serverType)
 {
 }
Пример #57
0
 public FbDatabaseSchemaTests(FbServerType serverType, bool compression)
     : base(serverType, compression)
 {
 }
		public FbParameterCollectionTests(FbServerType serverType)
			: base(serverType)
		{
		}
 public EntityFrameworkTests(FbServerType serverType)
     : base(serverType)
 {
 }
		public FbServicesTests(FbServerType serverType)
			: base(serverType, false)
		{
		}