コード例 #1
0
        public void GetFunctionTraceLevel_ReturnsExpectedLevel(string method, TraceLevel level)
        {
            // Arrange
            var             collector = new TestIndexCollector();
            FunctionIndexer product   = CreateProductUnderTest();

            // Act & Assert
            product.IndexMethodAsync(typeof(FunctionIndexerTests).GetMethod(method),
                                     collector, CancellationToken.None).GetAwaiter().GetResult();

            Assert.Equal(level, collector.Functions.First().TraceLevel);
        }
コード例 #2
0
        public void GetFunctionTimeout_ReturnsExpected()
        {
            // Arrange
            var             collector = new TestIndexCollector();
            FunctionIndexer product   = CreateProductUnderTest();

            // Act & Assert
            product.IndexMethodAsync(typeof(FunctionIndexerTests).GetMethod("Timeout_Set"),
                                     collector, CancellationToken.None).GetAwaiter().GetResult();

            Assert.Equal(TimeSpan.FromMinutes(30), collector.Functions.First().TimeoutAttribute.Timeout);
        }
コード例 #3
0
        public async Task FSharpTasks_AreCorrectlyIndexed()
        {
            // Arrange
            MethodInfo method = typeof(FSharpFunctions.TestFunction).GetMethod("TaskTest",
                                                                               BindingFlags.Static | BindingFlags.Public);

            Assert.NotNull(method); // Guard

            FunctionIndexer indexer        = FunctionIndexerFactory.Create(CloudStorageAccount.DevelopmentStorageAccount);
            var             indexCollector = new TestIndexCollector();

            // Act & Assert
            await indexer.IndexMethodAsyncCore(method, indexCollector, CancellationToken.None);

            Assert.Contains(indexCollector.Functions, d => string.Equals(d.ShortName, "TestFunction.TaskTest"));
        }