示例#1
0
        public async Task GetBlobStream_Error_InvalidAccount()
        {
            var cloudStorageSettings = new CloudStorageSettings()
            {
                ConnectionString = "",
                ContainerName    = "test"
            };

            var submisisionService = new SubmissionService.SubmissionService(null, cloudStorageSettings);
            await Assert.ThrowsAnyAsync <Exception>(() => submisisionService.GetBlobStream("test file"));
        }
示例#2
0
        public async Task GetBlobStream_Error_InvalidFileName()
        {
            var cloudStorageSettings = new CloudStorageSettings()
            {
                ConnectionString = "DefaultEndpointsProtocol=https;AccountName=xxxxxxxxxxxxxxx;AccountKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==;EndpointSuffix=core.windows.net",
                ContainerName    = "test"
            };

            var submisisionService = new SubmissionService.SubmissionService(null, cloudStorageSettings);
            await Assert.ThrowsAnyAsync <Exception>(() => submisisionService.GetBlobStream(null));
        }
示例#3
0
        public void GetBlobStream_Success()
        {
            var cloudStorageSettings = new CloudStorageSettings()
            {
                ConnectionString = "DefaultEndpointsProtocol=https;AccountName=xxxxxxxxxxxxxxx;AccountKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==;EndpointSuffix=core.windows.net",
                ContainerName    = "test"
            };

            var submisisionService = new SubmissionService.SubmissionService(null, cloudStorageSettings);

            submisisionService.GetBlobStream("test file").Should().BeAssignableTo <Task <CloudBlobStream> >();
        }
示例#4
0
        public async Task AddMessageToQueue_Success()
        {
            var cloudStorageSettings = new CloudStorageSettings()
            {
                ConnectionString = "DefaultEndpointsProtocol=https;AccountName=xxxxxxxxxxxxxxx;AccountKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==;EndpointSuffix=core.windows.net",
                ContainerName    = "test"
            };
            var queueClient = new Mock <IQueueClient>();

            var queue = new Mock <IServiceBusQueue>();

            var submisisionService = new SubmissionService.SubmissionService(queue.Object, cloudStorageSettings);
            await submisisionService.AddMessageToQueue(It.IsAny <string>(), It.IsAny <Guid>());

            queue.Verify(x => x.SendMessagesAsync(It.IsAny <string>(), It.IsAny <string>()), Times.Once);
        }