public void ToBlobPath_IfMalformedObjectKey_ReturnsNull(string requestedObjectKey) { StorageAnalyticsLogEntry entry = CreateEntry("2014-09-08T18:44:18.9681025Z", StorageServiceOperationType.PutBlob, StorageServiceType.Blob, requestedObjectKey); BlobPath blobPath = entry.ToBlobPath(); Assert.Null(blobPath); }
public void ToBlobPath_IfValidBlobOperationEntry_ReturnsBlobPath(object operationType, object serviceType, string requestedObjectKey, string expectedContainerName, string expectedBlobName) { StorageAnalyticsLogEntry entry = CreateEntry( "2014-09-08T18:44:18.9681025Z", (StorageServiceOperationType)operationType, (StorageServiceType)serviceType, requestedObjectKey); BlobPath blobPath = entry.ToBlobPath(); Assert.NotNull(blobPath); Assert.AreEqual(expectedContainerName, blobPath.ContainerName); Assert.AreEqual(expectedBlobName, blobPath.BlobName); }
public void ToBlobPath_IfMalformedUri_PropogatesUriFormatException(string requestedObjectKey) { StorageAnalyticsLogEntry entry = CreateEntry("2014-09-08T18:44:18.9681025Z", StorageServiceOperationType.PutBlob, StorageServiceType.Blob, requestedObjectKey); Assert.Throws <UriFormatException>(() => entry.ToBlobPath()); }