Exemple #1
0
        public void KeyCalculation()
        {
            using (var context = TestDwhDbContext.CreateDWHDbContext()) {
                var testRepo = new HubRepository <H_TestHub_Default>(context, HashFunctions.MD5, null, DVKeyCaching.Disabled);
                var loadDate = DateTime.Now;

                //single insert
                var test = testRepo.Insert(AdditionalTest, loadDate);
                Assert.Equal(HashFunctions.MD5(test.GetBusinessKeyString()), test.PrimaryKey);
                Assert.Equal(HashFunctions.MD5(test.GetBusinessKeyString()), testRepo.CalculateHashes(test).PrimaryKey);
            }
        }
        public void KeyCalculation()
        {
            using (var context = TestDwhDbContext.CreateDWHDbContext()) {
                var keyCache = new BasePrimaryKeyCache();
                var hubRepo  = new HubRepository <H_TestHub_Default>(context, HashFunctions.MD5, null);
                var linkRepo = new LinkRepository <L_TestLink_Default>(context, HashFunctions.MD5, keyCache, DVKeyCaching.Enabled);
                var loadDate = DateTime.Now;

                hubRepo.Insert(hubs, loadDate);

                L_TestLink_Default link = new L_TestLink_Default(hub1.PrimaryKey, hub2.PrimaryKey);
                //single insert
                var insertedLink = linkRepo.Insert(link, loadDate);
                Assert.Equal(HashFunctions.MD5(link.GetBusinessKeyString()), insertedLink.PrimaryKey);
            }
        }
Exemple #3
0
        public void KeyCalculation()
        {
            using (var context = TestDwhDbContext.CreateDWHDbContext()) {
                var hubRepo       = new HubRepository <H_TestHub_Default>(context, HashFunctions.MD5, null, DVKeyCaching.Disabled);
                var satelliteRepo = new SatelliteRepository <S_TestSatellite_Default>(context, HashFunctions.MD5);

                var loadDate = DateTime.Now;

                //single insert
                var testHub = hubRepo.Insert(TestHub1, loadDate);
                Assert.Equal(HashFunctions.MD5(testHub.GetBusinessKeyString()), testHub.PrimaryKey);
                Assert.Equal(HashFunctions.MD5(testHub.GetBusinessKeyString()), hubRepo.CalculateHashes(testHub).PrimaryKey);

                //single insert
                var testSatellite = satelliteRepo.Insert(Hub1Satellite1, loadDate);
                Assert.Equal(HashFunctions.MD5(testHub.GetBusinessKeyString()), testSatellite.Reference);
                Assert.Equal(HashFunctions.MD5(testHub.GetBusinessKeyString()), testSatellite.PrimaryKey.Reference);
            }
        }
 public byte[] MD5_SingleHash_EmptyInput()
 {
     return(HashFunctions.MD5(null));
 }
        public void MD5()
        {
            var hash = HashFunctions.MD5(null);

            Assert.Equal(MD5Empty, MakeHashString(hash));
        }