Beispiel #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);
            }
        }
Beispiel #2
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);
            }
        }