public async Task WhenSetFileProcessingCompleteCalledTwice_ItShouldHaveNoEffect()
        {
            await this.DatabaseTestAsync(async testDatabase =>
            {
                this.target = new SetFileProcessingCompleteDbStatement(testDatabase);

                await this.CreateUserAsync(testDatabase);
                await this.AddFileAsync(testDatabase);

                await this.target.ExecuteAsync(FileId, ProcessingAttempts, ProcessingStartedTimeStamp, ProcessingCompleteTimeStamp, RenderWidth, RenderWidth);
                await testDatabase.TakeSnapshotAsync();

                await this.target.ExecuteAsync(FileId, ProcessingAttempts, ProcessingStartedTimeStamp, ProcessingCompleteTimeStamp, RenderWidth, RenderWidth);
                return(ExpectedSideEffects.None);
            });
        }
        public async Task WhenSetFileProcessingCompleteCalled_ItShouldUpdateTheDatabase()
        {
            await this.DatabaseTestAsync(async testDatabase =>
            {
                this.target = new SetFileProcessingCompleteDbStatement(testDatabase);

                await this.CreateUserAsync(testDatabase);
                await this.AddFileAsync(testDatabase);
                await testDatabase.TakeSnapshotAsync();

                const long NewLength = 11111L;

                await this.target.ExecuteAsync(FileId, ProcessingAttempts, ProcessingStartedTimeStamp, ProcessingCompleteTimeStamp, RenderWidth, RenderWidth);

                var expectedFile = new File(
                    FileId.Value,
                    UserId.Value,
                    ChannelId.Value,
                    FileState.ProcessingComplete,
                    UploadStartedTimeStamp,
                    UploadCompleteTimeStamp,
                    ProcessingStartedTimeStamp,
                    ProcessingCompleteTimeStamp,
                    ProcessingAttempts,
                    FileNameWithoutExtension,
                    FileExtension,
                    NewLength,
                    Purpose,
                    RenderWidth,
                    RenderWidth);

                return(new ExpectedSideEffects
                {
                    Update = expectedFile,
                });
            });
        }
 public void Initialize()
 {
     this.target = new SetFileProcessingCompleteDbStatement(new Mock <IFifthweekDbConnectionFactory>(MockBehavior.Strict).Object);
 }