예제 #1
0
 public void GetSqlVersion_returns_correct_version_for_manifest_token()
 {
     Assert.Equal(SqlVersion.Sql8, SqlVersionUtils.GetSqlVersion("2000"));
     Assert.Equal(SqlVersion.Sql9, SqlVersionUtils.GetSqlVersion("2005"));
     Assert.Equal(SqlVersion.Sql10, SqlVersionUtils.GetSqlVersion("2008"));
     Assert.Equal(SqlVersion.Sql11, SqlVersionUtils.GetSqlVersion("2012"));
 }
예제 #2
0
        // <summary>
        // Initializes a new instance of the <see cref="SqlProviderManifest" /> class.
        // </summary>
        // <param name="manifestToken"> A token used to infer the capabilities of the store. </param>
        public SqlProviderManifest(string manifestToken)
            : base(GetProviderManifest())
        {
            // GetSqlVersion will throw ArgumentException if manifestToken is null, empty, or not recognized.
            _version = SqlVersionUtils.GetSqlVersion(manifestToken);

            Initialize();
        }
 public void GetSqlVersion_throws_for_unknown_version()
 {
     Assert.Equal(
         Strings.UnableToDetermineStoreVersion,
         Assert.Throws <ArgumentException>(() => SqlVersionUtils.GetSqlVersion("2014")).Message);
 }
 public void GetSqlVersion_returns_Sql8_for_server_version_string_greater_equal_to_8()
 {
     Assert.Equal(SqlVersion.Sql8, SqlVersionUtils.GetSqlVersion(CreateConnectionForVersion("08.12.1234")));
 }
 public void GetSqlVersion_returns_Sql11_for_server_version_string_greater_than_or_equal_to_11()
 {
     Assert.Equal(SqlVersion.Sql11, SqlVersionUtils.GetSqlVersion(CreateConnectionForVersion("11.12.1234")));
     Assert.Equal(SqlVersion.Sql11, SqlVersionUtils.GetSqlVersion(CreateConnectionForVersion("12.12.1234")));
 }
예제 #6
0
 public SqlProviderManifest(string manifestToken)
     : base(SqlProviderManifest.GetProviderManifest())
 {
     this._version = SqlVersionUtils.GetSqlVersion(manifestToken);
     this.Initialize();
 }