Skip to content

Commit ddcbf35

Browse files
committed
adding read me and fixing a few more new lines
1 parent 468e13a commit ddcbf35

File tree

6 files changed

+16
-0
lines changed

6 files changed

+16
-0
lines changed

test/Cli/Func.TestFramework/Assertions/CommandResultAssertions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

4+
// Based off of: https://github.com/dotnet/sdk/blob/e793aa4709d28cd783712df40413448250e26fea/test/Microsoft.NET.TestFramework/Assertions/CommandResultAssertions.cs
5+
46
using FluentAssertions;
57
using FluentAssertions.Execution;
68

test/Cli/Func.TestFramework/Assertions/CommandResultExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

4+
// Copied from: https://github.com/dotnet/sdk/blob/e793aa4709d28cd783712df40413448250e26fea/test/Microsoft.NET.TestFramework/Assertions/CommandResultExtensions.cs
5+
46
namespace Func.TestFramework.Assertions
57
{
68
public static class CommandResultExtensions

test/Cli/Func.TestFramework/Commands/FuncCommand.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

4+
// Based off of: https://github.com/dotnet/sdk/blob/e793aa4709d28cd783712df40413448250e26fea/test/Microsoft.NET.TestFramework/Commands/TestCommand.cs
5+
46
using Azure.Functions.Cli.Abstractions;
57
using System.Diagnostics;
68
using Xunit.Abstractions;

test/Cli/Func.TestFramework/Helpers/FunctionAppSetupHelper.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public static class FunctionAppSetupHelper
1111
public static async Task FuncInitWithRetryAsync(string funcPath, string testName, string workingDirectory, ITestOutputHelper log, IEnumerable<string> args)
1212
{
1313
int retryNumber = 1;
14+
1415
await RetryHelper.RetryAsync(
1516
() =>
1617
{
@@ -38,6 +39,7 @@ await RetryHelper.RetryAsync(
3839
public static async Task FuncNewWithRetryAsync(string funcPath, string testName, string workingDirectory, ITestOutputHelper log, IEnumerable<string> args, string workerRuntime = null)
3940
{
4041
int retryNumber = 1;
42+
4143
await RetryHelper.RetryAsync(
4244
() =>
4345
{

test/Cli/Func.TestFramework/Helpers/QueueStorageHelper.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ public async static Task<string> ReadFromQueue(string queueName)
5858
{
5959
var queueClient = CreateQueueClient(queueName);
6060
QueueMessage retrievedMessage = null;
61+
6162
await RetryHelper.RetryAsync(async () =>
6263
{
6364
Response<QueueMessage> response = await queueClient.ReceiveMessageAsync();
6465
retrievedMessage = response.Value;
6566
return retrievedMessage is not null;
6667
});
68+
6769
await queueClient.DeleteMessageAsync(retrievedMessage.MessageId, retrievedMessage.PopReceipt);
6870
return retrievedMessage.Body.ToString();
6971
}
@@ -78,11 +80,13 @@ await RetryHelper.RetryAsync(async () =>
7880
retrievedMessages = await queueClient.ReceiveMessagesAsync(maxMessages: 3);
7981
return retrievedMessages is not null;
8082
});
83+
8184
foreach (QueueMessage msg in retrievedMessages)
8285
{
8386
messages.Add(msg.Body.ToString());
8487
await queueClient.DeleteMessageAsync(msg.MessageId, msg.PopReceipt);
8588
}
89+
8690
return messages;
8791
}
8892
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This project contains the test framework that can be used for tests. `FuncCommand` is the base class that implements Command defined in the abstractions project.
2+
Each specific type of command, such as `FuncStartCommand`, can inherit from `FuncCommand` and be used in the tests directly.
3+
4+
Note that some of the classes are based off the [.NET sdk repo](https://github.com/dotnet/sdk).

0 commit comments

Comments
 (0)