Exemplo n.º 1
0
        /// <summary>
        ///     Initiates a full resync of all archive records.
        /// </summary>
        /// <param name="info">Information about who and when the request was sent.</param>
        /// <returns>Number of added records to the mutation table</returns>
        public int InitiateFullResync(ResyncRequestInfo info)
        {
            Log.Information("About to insert record ids into mutation table for full resync. Command was started by {username} at {startTime}",
                            info.Username, info.IssueDate);
            var affectedRecords = resyncAccess.InitiateFullResync(info);

            Log.Information("Finished inserting record ids into mutation table. A total of {affectedRecords} were added.", affectedRecords);
            return(affectedRecords);
        }
        public async Task If_resync_is_requested_the_init_method_is_called()
        {
            // Arrange
            var info = new ResyncRequestInfo {
                Username = "******", IssueDate = DateTime.Today
            };

            harvestManager.Setup(e => e.InitiateFullResync(It.IsAny <ResyncRequestInfo>())).Returns(999);

            // Act
            await InputQueueSendEndpoint.Send <IResyncArchiveDatabase>(new
            {
                RequestInfo = info
            });

            // Wait for the results
            await resyncArchiveDatabaseTask;
            var   context = await resyncArchiveDatabaseStartedTask;

            // Assert
            context.Message.InsertedRecords.Should().Be(999);
            harvestManager.Verify(e => e.InitiateFullResync(It.IsAny <ResyncRequestInfo>()));
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Initiates a full resync of all archive records.
        /// </summary>
        /// <param name="info">Information about who and when the request was sent.</param>
        /// <returns>Number of added records to the mutation table</returns>
        public int InitiateFullResync(ResyncRequestInfo info)
        {
            var affectedRecords = dataProvider.InitiateFullResync();

            return(affectedRecords);
        }