Пример #1
0
        public void ThenDataHistoryIsUpdatedWithStagingRecords()
        {
            InsertPendingLoadControl();

            HmrcDataTestsRepository
            .InsertIntoStaging(new DataStagingRecord {
                Record_ID = 1, SchemePAYERef = "999/RD11111"
            }).Wait();

            HmrcDataTestsRepository
            .InsertIntoStaging(new DataStagingRecord {
                Record_ID = 2, SchemePAYERef = "999/RD11112"
            }).Wait();

            HmrcDataTestsRepository.InsertIntoHistory(new DataHistoryRecord {
                Record_ID = 100, SourceFile_ID = 99, SchemePAYERef = "999/RD11112"
            }).Wait();


            HmrcDataTestsRepository.ExecuteLoadData().Wait();

            var loadControl = HmrcDataTestsRepository.GetLoadControl().Result;

            loadControl.Flag_LoadedSuccessfullyintoHistoryTable.Should().BeTrue();
        }
Пример #2
0
        public void ThenExistingSourceFileIdDataInHistoryDeleteLogIsCreated()
        {
            InsertPendingLoadControl();

            HmrcDataTestsRepository.InsertIntoHistory(new DataHistoryRecord {
                SourceFile_ID = 1, SchemePAYERef = ""
            }).Wait();
            HmrcDataTestsRepository.InsertIntoHistory(new DataHistoryRecord {
                SourceFile_ID = 1, SchemePAYERef = ""
            }).Wait();

            HmrcDataTestsRepository.ExecuteLoadData().Wait();

            var logs = HmrcDataTestsRepository.GetProcessLogs().Result;

            logs.Any(l => l.ProcessEventName == "History Table Records Deleted for SourceFile_ID - 1")
            .Should().BeTrue();
        }