Skip to content
This repository was archived by the owner on Apr 13, 2026. It is now read-only.

Commit e101e03

Browse files
Merge pull request #16 from FrendsPlatform/fspw-708
Fspw 708
2 parents 4c3a225 + 7eb8393 commit e101e03

6 files changed

Lines changed: 65 additions & 31 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#Rename this file to .env to run tests locally
2+
FRENDS_SECRET_KEY="example"

Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.Tests/Frends.Echo.Execute.Tests.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
<ItemGroup>
1313
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556"/>
1414
<PackageReference Include="coverlet.collector" Version="6.*"/>
15-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.*" />
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.*"/>
1616
<PackageReference Include="NUnit" Version="4.*"/>
17-
<PackageReference Include="NUnit3TestAdapter" Version="6.*" />
17+
<PackageReference Include="NUnit3TestAdapter" Version="6.*"/>
18+
<PackageReference Include="dotenv.net" Version="4.*"/>
1819
</ItemGroup>
1920
</Project>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System.Threading;
2+
using Frends.Echo.Execute.Definitions;
3+
using NUnit.Framework;
4+
5+
namespace Frends.Echo.Execute.Tests;
6+
7+
[TestFixture]
8+
public class FunctionalTests : TestBase
9+
{
10+
[Test]
11+
public void ShouldRepeatContentWithDelimiter()
12+
{
13+
var input = new Input
14+
{
15+
Content = "foobar",
16+
Repeat = 3,
17+
};
18+
19+
var connection = new Connection
20+
{
21+
ConnectionString = "Host=127.0.0.1;Port=12345",
22+
};
23+
24+
var options = new Options
25+
{
26+
Delimiter = ", ",
27+
ThrowErrorOnFailure = true,
28+
ErrorMessageOnFailure = null,
29+
};
30+
31+
var result = Echo.Execute(input, connection, options, CancellationToken.None);
32+
33+
Assert.That(result.Output, Is.EqualTo("foobar, foobar, foobar"));
34+
}
35+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using dotenv.net;
3+
4+
namespace Frends.Echo.Execute.Tests;
5+
6+
public abstract class TestBase
7+
{
8+
protected TestBase()
9+
{
10+
// TODO: Here you can load environment variables used in tests
11+
DotEnv.Load();
12+
SecretKey = Environment.GetEnvironmentVariable("FRENDS_SECRET_KEY");
13+
}
14+
15+
// TODO: Replace with your secret key or remove if not needed
16+
protected string SecretKey { get; }
17+
}

Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.Tests/UnitTests.cs

Lines changed: 0 additions & 23 deletions
This file was deleted.

FrendsTaskTemplate.csproj

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,27 @@
22

33
<PropertyGroup>
44
<PackageType>Template</PackageType>
5-
<PackageVersion>1.7.0</PackageVersion>
5+
<PackageVersion>1.8.0</PackageVersion>
66
<PackageId>frendstasktemplate</PackageId>
77
<Title>Frends Task template</Title>
88
<Authors>Frends</Authors>
99
<Description>Template for creating Frends Tasks.</Description>
1010
<PackageProjectUrl>https://github.com/FrendsPlatform/FrendsTaskTemplate</PackageProjectUrl>
1111
<PackageTags>dotnet-new;templates;frends</PackageTags>
1212
<TargetFramework>net8.0</TargetFramework>
13+
<PackageReadmeFile>README.md</PackageReadmeFile>
1314

1415
<IncludeContentInPack>true</IncludeContentInPack>
15-
<IncludeBuildOutput>false</IncludeBuildOutput>
1616
<ContentTargetFolders>content</ContentTargetFolders>
17-
<NoDefaultExcludes>true</NoDefaultExcludes>
1817
</PropertyGroup>
1918

2019
<ItemGroup>
21-
<Content Include="Frends.Template\**\*" Exclude="Frends.Template\**\bin\**;Frends.Template\**\obj\**" />
22-
<Compile Remove="**\*" />
23-
<None Include="README.md" Pack="true" PackagePath="\" />
20+
<Content Include="Frends.Template\**\*"
21+
Exclude="Frends.Template\**\bin\**;
22+
Frends.Template\**\obj\**;
23+
Frends.Template\**\.idea\**"/>
24+
<Compile Remove="**\*"/>
25+
<None Include="README.md" Pack="true" PackagePath="\"/>
2426
</ItemGroup>
2527

2628
</Project>

0 commit comments

Comments
 (0)