public void GetByPath(string guid, string path) { using (SerializationBlobStorageDataStore dataStore = this.CreateDataStore(this.useBlobListCache)) { IEnumerable <IItemData> items = dataStore.GetByPath(path, "master"); Assert.NotNull(items); Assert.Equal(1, items.Count()); } }
public void GetSnapshot() { using (SerializationBlobStorageDataStore dataStore = this.CreateDataStore(this.useBlobListCache)) { List <IItemData> items = dataStore.GetSnapshot().ToList(); Assert.NotEmpty(items); Assert.Equal(3, items.Count); } }
public void GetByPathAndId(string guid, string path) { using (SerializationBlobStorageDataStore dataStore = this.CreateDataStore(this.useBlobListCache)) { IItemData item = dataStore.GetByPathAndId(path, Guid.Parse(guid), "master"); Assert.NotNull(item); Assert.Equal(path, item.Path); } }
public void GetChildren(string guid, string path) { using (SerializationBlobStorageDataStore dataStore = this.CreateDataStore(this.useBlobListCache)) { IItemData parentItem = dataStore.GetById(Guid.Parse(guid), "master"); IEnumerable <IItemData> items = dataStore.GetChildren(parentItem); Assert.NotNull(items); Assert.Equal(2, items.Count()); IItemData rootItem = Assert.Single(items, x => x.Name == "Root"); Assert.Equal(1, rootItem.Versions.First().Fields.Count()); IItemFieldValue enCreatedField = rootItem.Versions.FirstOrDefault()?.Fields.FirstOrDefault(x => x.FieldId == Guid.Parse("25bed78c-4957-4165-998a-ca1b52f67497")); Assert.NotNull(enCreatedField?.Value); } }
public void GetMetadataByTemplateId() { Guid folderTemplateGuid = Guid.Parse("fe5dd826-48c6-436d-b87a-7c4210c7413b"); using (SerializationBlobStorageDataStore dataStore = this.CreateDataStore(this.useBlobListCache)) { IEnumerable <IItemMetadata> items = dataStore .GetMetadataByTemplateId(folderTemplateGuid, "master") .ToArray(); Assert.NotNull(items); Assert.Equal(3, items.Count()); Assert.Contains(items, x => x.Path == "/sitecore/media library/Imported"); Assert.Contains(items, x => x.Path == "/sitecore/media library/Imported/By Type"); } }