public void PseudonymizationProviderFactory_GetProviderByName_ReturnsProvider()
        {
            var factory  = new PseudonymizationProviderFactory();
            var provider = factory.GetProvider(typeof(SqlServerPseudonymizationProvider).FullName, connStr);

            Assert.IsNotNull(provider);
            Assert.IsInstanceOfType(provider, typeof(SqlServerPseudonymizationProvider));
        }
        public void PseudonymizationProviderFactory_GetPseudonymizationColumnsFromSchemaAsync_ThrowsNoExceptions()
        {
            var factory = new PseudonymizationProviderFactory();

            var p = factory.GetProvider(typeof(SqlServerPseudonymizationProvider).FullName, connStr);

            p.GetPseudonymizationColumnsFromSchemaAsync(CancellationToken.None).GetAwaiter().GetResult();
        }
Exemple #3
0
        public void TestFullSqlPseudo()
        {
            var factory    = new PseudonymizationProviderFactory();
            var p          = factory.GetProvider(typeof(SqlServerPseudonymizationProvider).FullName, _connStr);
            var schemaList = p.GetPseudonymizationColumnsFromSchemaAsync(CancellationToken.None).GetAwaiter().GetResult();

            p.PseudonymizeAsync(schemaList).GetAwaiter().GetResult();
        }
Exemple #4
0
        public void TestAccessibility()
        {
            var factory    = new PseudonymizationProviderFactory();
            var p          = factory.GetProvider(typeof(SqlServerPseudonymizationProvider).FullName, _connStr);
            var accessible = p.Accessible;

            Assert.IsTrue(accessible);
        }
Exemple #5
0
        public void TestTablePseudo()
        {
            var factory = new PseudonymizationProviderFactory();

            var p = factory.GetProvider(typeof(SqlServerPseudonymizationProvider).FullName, _connStr);

            //(p as SqlServerPseudonymizationProvider).PseudonymizeTable(
            //    "dbo",
            //    "Customers",
            //    new HashSet<ColumnMetadata>() { new ColumnMetadata("ContactEmail") { MaxLength = 128 } });//.GetAwaiter().GetResult();
        }
        public void PseudonymizationProviderFactory_GetProviderByName_ThrowsInnerProviderNotFoundException()
        {
            var factory = new PseudonymizationProviderFactory();

            try
            {
                var provider = factory.GetProvider(typeof(PseudonymizationProviderFactory).FullName, connStr);
            }
            catch (ProviderInitializationFailedException ex)
                when(ex.InnerException is ProviderNotFoundException)
                {
                    Assert.IsTrue(true);
                }
            catch (Exception ex)
            {
                Assert.Fail();
            }
        }
 public void PseudonymizationProviderFactory_GetProviderByName_ThrowsProviderInitializationFailedException()
 {
     var factory  = new PseudonymizationProviderFactory();
     var provider = factory.GetProvider(typeof(PseudonymizationProviderFactory).FullName, connStr);
 }