public void GetBlobIfNotModifiedNoChangeNoRetrieval() { BlobStorage.PutBlob(ContainerName, BlobName, 1); var etag = BlobStorage.GetBlobEtag(ContainerName, BlobName); string newEtag; var output = BlobStorage.GetBlobIfModified <MyBlob>(ContainerName, BlobName, etag, out newEtag); Assert.IsNull(newEtag, "#A00"); Assert.IsFalse(output.HasValue, "#A01"); }
public Maybe <CloudApplicationDefinition> Inspect() { var runtimeSerializer = new CloudFormatter(); var definitionBlob = _blobs.GetBlob <CloudApplicationDefinition>(ContainerName, ApplicationDefinitionBlobName, runtimeSerializer); Maybe <byte[]> packageBlob; string packageETag; if (definitionBlob.HasValue) { packageBlob = _blobs.GetBlobIfModified <byte[]>(AssemblyLoader.ContainerName, AssemblyLoader.PackageBlobName, definitionBlob.Value.PackageETag, out packageETag, runtimeSerializer); if (!packageBlob.HasValue || definitionBlob.Value.PackageETag == packageETag) { return(definitionBlob.Value); } } else { packageBlob = _blobs.GetBlob <byte[]>(AssemblyLoader.ContainerName, AssemblyLoader.PackageBlobName, out packageETag, runtimeSerializer); } if (!packageBlob.HasValue) { return(Maybe <CloudApplicationDefinition> .Empty); } var definition = Analyze(packageBlob.Value, packageETag); _blobs.PutBlob(ContainerName, ApplicationDefinitionBlobName, definition, runtimeSerializer); return(definition); }