Exemple #1
0
        public void BuildSqLiteEntityConnectionString_InvalidPathToSqLiteFile_ThrowsArgumentNullException(string invalidPathToSqLiteFile)
        {
            // Call
            TestDelegate test = () => SqLiteEntityConnectionStringBuilder.BuildSqLiteEntityConnectionString(
                invalidPathToSqLiteFile);

            // Assert
            Assert.Throws <ArgumentNullException>(test);
        }
Exemple #2
0
        public void BuildSqLiteEntityConnectionString_ValidPathToSqLiteFile_ValidConnectionString()
        {
            // Call
            string connectionString = SqLiteEntityConnectionStringBuilder.BuildSqLiteEntityConnectionString(
                pathToSqLiteFile);

            // Assert
            Assert.That(!string.IsNullOrEmpty(connectionString));
            StringAssert.Contains(string.Format("metadata=res://*/{0}.csdl|res://*/{0}.ssdl|res://*/{0}.msl;",
                                                "DbContext.RiskeerEntities"), connectionString);
            StringAssert.Contains("provider=System.Data.SQLite.EF6", connectionString);
            StringAssert.Contains("failifmissing=True", connectionString);
            StringAssert.Contains($"data source={pathToSqLiteFile}", connectionString);
            StringAssert.Contains("read only=False", connectionString);
            StringAssert.Contains("foreign keys=True", connectionString);
            StringAssert.Contains("version=3", connectionString);
            StringAssert.Contains("pooling=False", connectionString);
        }