Ejemplo n.º 1
0
 private void CallbackSchedulesBackgroundTask(
     MockBackgroundFileSystemTaskRunner backgroundTaskRunner,
     Action <string> callback,
     string path,
     FileSystemTask.OperationType operationType)
 {
     callback(path);
     backgroundTaskRunner.Count.ShouldEqual(1);
     backgroundTaskRunner.BackgroundTasks[0].Operation.ShouldEqual(operationType);
     backgroundTaskRunner.BackgroundTasks[0].VirtualPath.ShouldEqual(path);
     backgroundTaskRunner.BackgroundTasks.Clear();
 }
Ejemplo n.º 2
0
        private void ValidateActionInvalidatesStatusCache(
            MockBackgroundFileSystemTaskRunner backgroundTaskRunner,
            MockGitStatusCache gitStatusCache,
            Action <string> action,
            string path,
            FileSystemTask.OperationType operationType)
        {
            action(path);

            backgroundTaskRunner.Count.ShouldEqual(1);
            backgroundTaskRunner.BackgroundTasks[0].Operation.ShouldEqual(operationType);
            backgroundTaskRunner.BackgroundTasks[0].VirtualPath.ShouldEqual(path);

            backgroundTaskRunner.ProcessTasks();

            gitStatusCache.InvalidateCallCount.ShouldEqual(1);

            gitStatusCache.ResetCalls();
            backgroundTaskRunner.BackgroundTasks.Clear();
        }
Ejemplo n.º 3
0
 public void BackgroundTaskShouldBeScheduled(string expectedPath, FileSystemTask.OperationType expectedOperationType)
 {
     this.BackgroundTaskRunner.Count.ShouldEqual(1);
     this.BackgroundTaskRunner.BackgroundTasks[0].Operation.ShouldEqual(expectedOperationType);
     this.BackgroundTaskRunner.BackgroundTasks[0].VirtualPath.ShouldEqual(expectedPath);
 }