Ejemplo n.º 1
0
        public static AppFileEntryChangeDto MapToAppFileEntryChangeDto(AppFileEntryChange src)
        {
            var appFile = MapToAppFileDto(src.AppFileEntry);

            var changeType = MapToAppFileChangeTypeDto(src.ChangeType);

            return(new AppFileEntryChangeDto(appFile, changeType, src.Content));
        }
Ejemplo n.º 2
0
        public static AppFileEntryChange MapToAppFileEntryChange(FileSystemEntryChange fileChange, int id, int parentId)
        {
            var isDirectory = PathHelper
                              .IsDirectoryPath(fileChange.Path);

            var appFileEntry = new AppFileEntry(id, parentId,
                                                fileChange.Name, isDirectory);

            var appFileChangeType = MapToAppFileEntryChangeType(fileChange.ChangeType);

            var content = GetContent(fileChange, isDirectory);

            var appFileChange = new AppFileEntryChange(appFileEntry,
                                                       appFileChangeType, content);

            return(appFileChange);
        }
Ejemplo n.º 3
0
        protected override Task Given()
        {
            var mockPublishChangesStep = new Mock <IFileChangePipelinePublishChangesStep>();

            mockPublishChangesStep.Setup(h => h.Execute(It.IsAny <List <AppFileEntryChange> >()))
            .Callback <List <AppFileEntryChange> >(r => _result = r.FirstOrDefault());

            _logicPathRepository = GetService <ILogicPathRepository>();

            _step = new FileChangePipelineTransformChangeToLogicStep(_logicPathRepository,
                                                                     mockPublishChangesStep.Object);

            var path = GetResourcesPath("FileChangePipelineConvertChangeToLogicStepTests", "demo.txt");

            _fileSystemEntryChange  = new FileSystemEntryChange(FileSystemEntryChangeType.Changed, "demo.txt", path);
            _fileSystemEntryChanges = new List <FileSystemEntryChange>
            {
                _fileSystemEntryChange
            };

            return(Task.CompletedTask);
        }