Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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());
        }