Esempio n. 1
0
        public void TryConvert_ConvertString_Failure(string value)
        {
            Mock <IStorageBlobClient> mockStorageClient = new Mock <IStorageBlobClient>(MockBehavior.Strict);

            IStorageBlobContainer container = null;
            BlobPath path = null;

            Assert.Throws <FormatException>(() =>
            {
                BlobContainerBinding.TryConvert(value, mockStorageClient.Object, out container, out path);
            });
        }
Esempio n. 2
0
        public void TryConvert_ConvertString_Success(string value, string expectedContainerValue, string expectedBlobValue)
        {
            Mock <IStorageBlobClient>    mockStorageClient    = new Mock <IStorageBlobClient>(MockBehavior.Strict);
            Mock <IStorageBlobContainer> mockStorageContainer = new Mock <IStorageBlobContainer>(MockBehavior.Strict);

            mockStorageClient.Setup(p => p.GetContainerReference(expectedContainerValue)).Returns(mockStorageContainer.Object);

            IStorageBlobContainer container = null;
            BlobPath path   = null;
            bool     result = BlobContainerBinding.TryConvert(value, mockStorageClient.Object, out container, out path);

            Assert.True(result);
            Assert.Equal(expectedContainerValue, path.ContainerName);
            Assert.Equal(expectedBlobValue, path.BlobName);

            mockStorageClient.VerifyAll();
        }