Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions test-outofproc/MultiFunctionTrigger.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using DotnetIsolatedTests.Common;
using Microsoft.Extensions.Logging;
Expand All @@ -15,22 +16,24 @@ namespace DotnetIsolatedTests
/// </summary>
public static class MultiFunctionTrigger
{
private static readonly Action<ILogger, string, Exception> _loggerMessage = LoggerMessage.Define<string>(LogLevel.Information, eventId: new EventId(0, "INFO"), formatString: "{Message}");

[Function(nameof(MultiFunctionTrigger1))]
public static void MultiFunctionTrigger1(
[SqlTrigger("[dbo].[Products]", "SqlConnectionString")]
IReadOnlyList<SqlChange<Product>> products,
ILogger logger)
FunctionContext context)
{
logger.LogInformation("Trigger1 Changes: " + Utils.JsonSerializeObject(products));
_loggerMessage(context.GetLogger("ProductsTriggerWithValidation"), "Trigger1 Changes: " + Utils.JsonSerializeObject(products), null);
}

[Function(nameof(MultiFunctionTrigger2))]
public static void MultiFunctionTrigger2(
[SqlTrigger("[dbo].[Products]", "SqlConnectionString")]
IReadOnlyList<SqlChange<Product>> products,
ILogger logger)
FunctionContext context)
{
logger.LogInformation("Trigger2 Changes: " + Utils.JsonSerializeObject(products));
_loggerMessage(context.GetLogger("ProductsTriggerWithValidation"), "Trigger2 Changes: " + Utils.JsonSerializeObject(products), null);
}
}
}
12 changes: 6 additions & 6 deletions test/Integration/SqlTriggerBindingIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ await this.WaitForProductChanges(
/// </summary>
[Theory]
[SqlInlineData()]
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
public async Task PollingIntervalOverrideTriggerTest(SupportedLanguages lang)
{
const int firstId = 1;
Expand Down Expand Up @@ -293,7 +293,7 @@ await this.WaitForProductChanges(
/// </summary>
[Theory]
[SqlInlineData()]
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
public async Task MultiFunctionTriggerTest(SupportedLanguages lang)
{
const string Trigger1Changes = "Trigger1 Changes: ";
Expand Down Expand Up @@ -472,7 +472,7 @@ await this.WaitForProductChanges(
/// </summary>
[Theory]
[SqlInlineData()]
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
public void TableNotPresentTriggerTest(SupportedLanguages lang)
{
this.StartFunctionHostAndWaitForError(
Expand All @@ -487,7 +487,7 @@ public void TableNotPresentTriggerTest(SupportedLanguages lang)
/// </summary>
[Theory]
[SqlInlineData()]
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
public void PrimaryKeyNotCreatedTriggerTest(SupportedLanguages lang)
{
this.StartFunctionHostAndWaitForError(
Expand All @@ -503,7 +503,7 @@ public void PrimaryKeyNotCreatedTriggerTest(SupportedLanguages lang)
/// </summary>
[Theory]
[SqlInlineData()]
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
public void ReservedPrimaryKeyColumnNamesTriggerTest(SupportedLanguages lang)
{
this.StartFunctionHostAndWaitForError(
Expand All @@ -519,7 +519,7 @@ public void ReservedPrimaryKeyColumnNamesTriggerTest(SupportedLanguages lang)
/// </summary>
[Theory]
[SqlInlineData()]
[UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)]
[UnsupportedLanguages(SupportedLanguages.CSharpscript)]
public void UnsupportedColumnTypesTriggerTest(SupportedLanguages lang)
{
this.StartFunctionHostAndWaitForError(
Expand Down