Пример #1
0
        public async Task BlobFunction_ValidStreamAndName()
        {
            Stream s = new MemoryStream();

            using (StreamWriter sw = new StreamWriter(s))
            {
                await sw.WriteLineAsync("This is a test");

                BlobTrigger.Run(s, "testBlob", log);
            }
        }
Пример #2
0
            public async Task BlobTrigger_Starts_With_Correct_Input()
            {
                // Arrange
                const string expectedInputName = "TestInput";

                var durableOrchestrationClient = new Mock <IDurableOrchestrationClient>();
                var cloudblockBlob             = new Mock <CloudBlockBlob>(new Uri("http://tempuri.org/blob"));
                var logger = new Mock <ILogger>();

                // Act
                await BlobTrigger.BlobTriggerStart(cloudblockBlob.Object, expectedInputName, durableOrchestrationClient.Object, logger.Object);

                // Assert
                durableOrchestrationClient.Verify(s => s.StartNewAsync(
                                                      It.Is <string>(s => s == nameof(FileProcessingOrchestrator)),
                                                      It.Is <string>(s => s == string.Empty),
                                                      It.Is <string>(s => s == expectedInputName)));
            }