CreateEvents() public method

Creates the local events and returns the creationEvents, the other Events are stored in the eventMap, handled objects are removed from storedObjects
public CreateEvents ( List storedObjects, IObjectTree localTree, AbstractFolderEvent>.Dictionary eventMap, ISet handledStoredObjects ) : List
storedObjects List /// Stored objects. ///
localTree IObjectTree /// Local tree. ///
eventMap AbstractFolderEvent>.Dictionary /// Event map. ///
handledStoredObjects ISet
return List
        public void RenameOnSubFolder() {
            var storage = new Mock<IMetaDataStorage>();
            var fsFactory = new Mock<IFileSystemInfoFactory>();
            var underTest = new LocalEventGenerator(storage.Object, fsFactory.Object);
            Dictionary<string, Tuple<AbstractFolderEvent, AbstractFolderEvent>> eventMap = new Dictionary<string, Tuple<AbstractFolderEvent, AbstractFolderEvent>>();

            Guid rootGuid = Guid.NewGuid();
            var rootName = "root";
            var rootPath = Path.Combine(Path.GetTempPath(), rootName);
            var rootObjectId = "rootId";
            ObjectTree<IFileSystemInfo> rootTree = this.CreateTreeFromPathAndGuid(rootName, rootPath, rootGuid);

            Guid subFolderGuid = Guid.NewGuid();
            var subName = "A";
            var subPath = Path.Combine(rootPath, subName);
            var subFolderId = "subId";
            ObjectTree<IFileSystemInfo> subFolder = this.CreateTreeFromPathAndGuid(subName, subPath, subFolderGuid);
            rootTree.Children.Add(subFolder);

            Guid subSubFolderGuid = Guid.NewGuid();
            var subSubName = "B";
            var subSubPath = Path.Combine(subPath, subSubName);
            var subSubFolderId = "subId";
            ObjectTree<IFileSystemInfo> subSubFolder = this.CreateTreeFromPathAndGuid(subSubName, subSubPath, subSubFolderGuid);
            subFolder.Children.Add(subSubFolder);

            List<IMappedObject> storedObjectsForLocal = new List<IMappedObject>();
            var rootMappedObject = this.CreateStoredObjectMock(rootGuid, rootObjectId, rootName, null);
            storedObjectsForLocal.Add(rootMappedObject);
            var subMappedObject = this.CreateStoredObjectMock(subFolderGuid, subFolderId, subName, rootObjectId);
            storedObjectsForLocal.Add(subMappedObject);
            var subSubMappedObject = this.CreateStoredObjectMock(subSubFolderGuid, subSubFolderId, "oldsubsubName", subSubFolderId);
            storedObjectsForLocal.Add(subSubMappedObject);

            storage.Setup(s => s.GetLocalPath(rootMappedObject)).Returns(rootPath);
            storage.Setup(s => s.GetLocalPath(subMappedObject)).Returns(subPath);
            storage.Setup(s => s.GetLocalPath(subSubMappedObject)).Returns(subSubPath);

            ISet<IMappedObject> handledLocalStoredObjects = new HashSet<IMappedObject>();
            List<AbstractFolderEvent> creationEvents = underTest.CreateEvents(storedObjectsForLocal, rootTree, eventMap, handledLocalStoredObjects);
            foreach (var handledObjects in handledLocalStoredObjects) {
                storedObjectsForLocal.Remove(handledObjects);
            }

            storedObjectsForLocal.Remove(rootMappedObject);
            Assert.That(creationEvents, Is.Empty);
            Assert.That(storedObjectsForLocal, Is.Empty);
            Assert.That(eventMap.Count, Is.EqualTo(1));
            Assert.That(eventMap[subSubFolderId], Is.Not.Null);
            Assert.That(eventMap[subSubFolderId].Item1.Local, Is.EqualTo(MetaDataChangeType.CHANGED));
        }