public void MSONESTORE_S02_TC05_LoadOneNoteWithLargeReferences() { string fileName = Common.GetConfigurationPropertyValue("OneWithLarge", Site); OneNoteRevisionStoreFile file = this.Adapter.LoadOneNoteFile(fileName); int objectSpaceCount = file.RootFileNodeList.ObjectSpaceManifestList.Count; for (int i = 0; i < file.RootFileNodeList.ObjectSpaceManifestList.Count; i++) { ObjectSpaceManifestList objectSpace = file.RootFileNodeList.ObjectSpaceManifestList[i]; for (int j = 0; j < objectSpace.RevisionManifestList[0].ObjectGroupList.Count; j++) { ObjectGroupList objectGroupList = objectSpace.RevisionManifestList[0].ObjectGroupList[j]; FileNode[] fileNodes = objectGroupList.FileNodeSequence.Where(f => f.FileNodeID == FileNodeIDValues.ObjectDeclarationFileData3LargeRefCountFND).ToArray(); foreach (FileNode node in fileNodes) { ObjectDeclarationFileData3LargeRefCountFND fnd = node.fnd as ObjectDeclarationFileData3LargeRefCountFND; // Verify MS-ONESTORE requirement: MS-ONESTORE_R72 Site.CaptureRequirementIfIsTrue( (uint)node.FileNodeID == 0x073 && fnd.jcid.IsFileData == 1, 72, @"[In Object Space Object]If the value of the JCID.IsFileData field is ""true"" then the value of the FileNode.FileNodeID field MUST be [0x072 (ObjectDeclarationFileData3RefCountFND structure, section 2.5.27) or] 0x073 (ObjectDeclarationFileData3LargeRefCountFND structure, section 2.5.28)."); } } } }
public void MSONESTORE_S01_TC04_QueryOneFileWithLargeReferences() { // Get the resource url that contains the file data. string resourceName = Common.GetConfigurationPropertyValue("OneWithLarge", Site); string url = this.GetResourceUrl(resourceName); this.InitializeContext(url, this.UserName, this.Password, this.Domain); // Call QueryChange to get the data that is specified by above step. CellSubRequestType cellSubRequest = this.CreateCellSubRequestEmbeddedQueryChanges(SequenceNumberGenerator.GetCurrentSerialNumber()); CellStorageResponse cellStorageResponse = this.SharedAdapter.CellStorageRequest(url, new SubRequestType[] { cellSubRequest }); MSOneStorePackage package = this.ConvertOneStorePackage(cellStorageResponse); // Call adapter to load same file in local. OneNoteRevisionStoreFile file = this.Adapter.LoadOneNoteFile(resourceName); int objectSpaceCount = file.RootFileNodeList.ObjectSpaceManifestList.Count; List <FileNode> fileData3LargeRefs = new List <FileNode>(); for (int i = 0; i < file.RootFileNodeList.ObjectSpaceManifestList.Count; i++) { ObjectSpaceManifestList objectSpace = file.RootFileNodeList.ObjectSpaceManifestList[i]; for (int j = 0; j < objectSpace.RevisionManifestList[0].ObjectGroupList.Count; j++) { ObjectGroupList objectGroupList = objectSpace.RevisionManifestList[0].ObjectGroupList[j]; fileData3LargeRefs.AddRange(objectGroupList.FileNodeSequence.Where(f => f.FileNodeID == FileNodeIDValues.ObjectDeclarationFileData3LargeRefCountFND).ToArray()); } } List <RevisionStoreObject> objectsWithFileData = new List <RevisionStoreObject>(); foreach (RevisionStoreObjectGroup objGroup in package.DataRoot) { objectsWithFileData.AddRange(objGroup.Objects.Where(o => o.FileDataObject != null).ToArray()); } foreach (RevisionStoreObjectGroup objGroup in package.OtherFileNodeList) { objectsWithFileData.AddRange(objGroup.Objects.Where(o => o.FileDataObject != null).ToArray()); } foreach (RevisionStoreObject obj in objectsWithFileData) { Guid fileDataObjectGuid = this.GetFileDataObjectGUID(obj); string extension = this.GetFileDataObjectExtension(obj); if (extension.ToLower().Contains("xps")) { foreach (FileNode fnode in fileData3LargeRefs) { ObjectDeclarationFileData3LargeRefCountFND fnd = fnode.fnd as ObjectDeclarationFileData3LargeRefCountFND; if (fnd.FileDataReference.StringData.ToLower().Contains(fileDataObjectGuid.ToString().ToLower())) { // Verify MS-ONESTORE requirement: MS-ONESTORE_R952 Site.CaptureRequirementIfIsTrue( fnd.FileDataReference.StringData.StartsWith("<invfdo>") == false, 952, @"[In Objects] This property MUST be set only if the prefix specified by the [ObjectDeclarationFileData3RefCountFND.FileDataReference field (section 2.5.27) or] ObjectDeclarationFileData3LargeRefCountFND.FileDataReference field (section 2.5.28) is not <invfdo>."); // Verify MS-ONESTORE requirement: MS-ONESTORE_R959 Site.CaptureRequirementIfAreEqual <string>( fnd.Extension.StringData, extension, 959, @"[In Objects] MUST be the value specified by the [ObjectDeclarationFileData3RefCountFND.Extension field or] the ObjectDeclarationFileData3LargeRefCountFND.Extension field."); break; } } } } }