Skip to content

Commit 4c0c4d6

Browse files
dsymefabiocav
authored andcommitted
adding tests
1 parent 20e6fba commit 4c0c4d6

File tree

30 files changed

+199
-21
lines changed

30 files changed

+199
-21
lines changed

test/WebJobs.Script.Tests/CSharpEndToEndTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ public async Task ServiceBusQueueTriggerToBlobTest()
3232
await ServiceBusQueueTriggerToBlobTestImpl();
3333
}
3434

35+
[Fact]
36+
public async Task TwilioReferenceInvokeSucceeds()
37+
{
38+
await TwilioReferenceInvokeSucceedsImpl(isDotNet: true);
39+
}
40+
3541
[Fact]
3642
public async Task MobileTables()
3743
{

test/WebJobs.Script.Tests/EndToEndTestsBase.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,26 @@ public async Task QueueTriggerToBlobTest()
157157
Assert.True(trace.Replace(" ", string.Empty).Contains(messageContent.Replace(" ", string.Empty)));
158158
}
159159

160+
protected async Task TwilioReferenceInvokeSucceedsImpl(bool isDotNet)
161+
{
162+
if (isDotNet)
163+
{
164+
TestHelpers.ClearFunctionLogs("TwilioReference");
165+
166+
string testData = Guid.NewGuid().ToString();
167+
string inputName = "input";
168+
Dictionary<string, object> arguments = new Dictionary<string, object>
169+
{
170+
{ inputName, testData }
171+
};
172+
await Fixture.Host.CallAsync("TwilioReference", arguments);
173+
174+
// make sure the input string made it all the way through
175+
var logs = await TestHelpers.GetFunctionLogsAsync("TwilioReference");
176+
Assert.True(logs.Any(p => p.Contains(testData)));
177+
}
178+
}
179+
160180
protected async Task DocumentDBTest()
161181
{
162182
// DocumentDB tests need the following environment vars:

test/WebJobs.Script.Tests/FSharpEndToEndTests.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ public async Task ServiceBusQueueTriggerToBlobTest()
2727
await ServiceBusQueueTriggerToBlobTestImpl();
2828
}
2929

30+
[Fact]
31+
public async Task TwilioReferenceInvokeSucceeds()
32+
{
33+
await TwilioReferenceInvokeSucceedsImpl(isDotNet: true);
34+
}
35+
3036
//[Fact]
3137
//public async Task MobileTables()
3238
//{
@@ -172,6 +178,24 @@ public async Task SharedAssemblyDependenciesAreLoaded()
172178
Assert.Equal("secondary type value", request.Properties["DependencyOutput"]);
173179
}
174180

181+
[Fact]
182+
public async Task NugetChartingReferencesInvokeSucceeds()
183+
{
184+
TestHelpers.ClearFunctionLogs("NugetChartingReferences");
185+
186+
string testData = Guid.NewGuid().ToString();
187+
string inputName = "input";
188+
Dictionary<string, object> arguments = new Dictionary<string, object>
189+
{
190+
{ inputName, testData }
191+
};
192+
await Fixture.Host.CallAsync("NugetChartingReferences", arguments);
193+
194+
// make sure the input string made it all the way through
195+
var logs = await TestHelpers.GetFunctionLogsAsync("NugetChartingReferences");
196+
Assert.True(logs.Any(p => p.Contains(testData)));
197+
}
198+
175199
[Fact]
176200
public async Task PrivateAssemblyDependenciesAreLoaded()
177201
{
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"bindings": [
3+
{
4+
"type": "manualTrigger",
5+
"name": "input",
6+
"direction": "in"
7+
}
8+
]
9+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#r "Twilio.Api"
2+
3+
using System;
4+
using Microsoft.Azure.WebJobs.Host;
5+
using Twilio;
6+
7+
public static void Run(string input, TraceWriter log)
8+
{
9+
log.Info(input);
10+
}

test/WebJobs.Script.Tests/TestScripts/FSharp/ApiHubFileSender/run.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This prelude allows scripts to be edited in Visual Studio or another F# editing environment
33

44
#if !COMPILED
5-
#I "../../../../../bin/Binaries/WebJobs.Script.Host"
5+
#I "../../../../../src/WebJobs.Script.Host/bin/Debug"
66
#r "Microsoft.Azure.WebJobs.Host.dll"
77
#r "Microsoft.Azure.WebJobs.Extensions.dll"
88
#endif

test/WebJobs.Script.Tests/TestScripts/FSharp/ApiHubFileTrigger/run.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This prelude allows scripts to be edited in Visual Studio or another F# editing environment
33

44
#if !COMPILED
5-
#I "../../../../../bin/Binaries/WebJobs.Script.Host"
5+
#I "../../../../../src/WebJobs.Script.Host/bin/Debug"
66
#r "Microsoft.Azure.WebJobs.Host.dll"
77
#r "Microsoft.Azure.WebJobs.Extensions.dll"
88
#endif

test/WebJobs.Script.Tests/TestScripts/FSharp/ApiHubTable/run.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This prelude allows scripts to be edited in Visual Studio or another F# editing environment
33

44
#if !COMPILED
5-
#I "../../../../../bin/Binaries/WebJobs.Script.Host"
5+
#I "../../../../../src/WebJobs.Script.Host/bin/Debug"
66
#r "Microsoft.Azure.WebJobs.Host.dll"
77
#r "Microsoft.Azure.WebJobs.Extensions.dll"
88
#endif

test/WebJobs.Script.Tests/TestScripts/FSharp/ApiHubTableClient/run.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This prelude allows scripts to be edited in Visual Studio or another F# editing environment
33

44
#if !COMPILED
5-
#I "../../../../../bin/Binaries/WebJobs.Script.Host"
5+
#I "../../../../../src/WebJobs.Script.Host/bin/Debug"
66
#r "Microsoft.Azure.WebJobs.Host.dll"
77
#r "Microsoft.Azure.WebJobs.Extensions.dll"
88
#endif

test/WebJobs.Script.Tests/TestScripts/FSharp/ApiHubTableEntity/run.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This prelude allows scripts to be edited in Visual Studio or another F# editing environment
33

44
#if !COMPILED
5-
#I "../../../../../bin/Binaries/WebJobs.Script.Host"
5+
#I "../../../../../src/WebJobs.Script.Host/bin/Debug"
66
#r "Microsoft.Azure.WebJobs.Host.dll"
77
#r "Microsoft.Azure.WebJobs.Extensions.dll"
88
#endif

0 commit comments

Comments
 (0)