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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Rename this file to .env to run tests locally
FRENDS_SECRET_KEY="example"
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556"/>
<PackageReference Include="coverlet.collector" Version="6.*"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.*"/>
<PackageReference Include="NUnit" Version="4.*"/>
<PackageReference Include="NUnit3TestAdapter" Version="6.*" />
<PackageReference Include="NUnit3TestAdapter" Version="6.*"/>
<PackageReference Include="dotenv.net" Version="4.*"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Threading;
using Frends.Echo.Execute.Definitions;
using NUnit.Framework;

namespace Frends.Echo.Execute.Tests;

[TestFixture]
public class FunctionalTests : TestBase
{
[Test]
public void ShouldRepeatContentWithDelimiter()
{
var input = new Input
{
Content = "foobar",
Repeat = 3,
};

var connection = new Connection
{
ConnectionString = "Host=127.0.0.1;Port=12345",
};

var options = new Options
{
Delimiter = ", ",
ThrowErrorOnFailure = true,
ErrorMessageOnFailure = null,
};

var result = Echo.Execute(input, connection, options, CancellationToken.None);

Assert.That(result.Output, Is.EqualTo("foobar, foobar, foobar"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using dotenv.net;

namespace Frends.Echo.Execute.Tests;

public abstract class TestBase
{
protected TestBase()
{
// TODO: Here you can load environment variables used in tests
DotEnv.Load();
SecretKey = Environment.GetEnvironmentVariable("FRENDS_SECRET_KEY");
}

// TODO: Replace with your secret key or remove if not needed
protected string SecretKey { get; }
}

This file was deleted.

14 changes: 8 additions & 6 deletions FrendsTaskTemplate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@

<PropertyGroup>
<PackageType>Template</PackageType>
<PackageVersion>1.7.0</PackageVersion>
<PackageVersion>1.8.0</PackageVersion>
<PackageId>frendstasktemplate</PackageId>
<Title>Frends Task template</Title>
<Authors>Frends</Authors>
<Description>Template for creating Frends Tasks.</Description>
<PackageProjectUrl>https://github.com/FrendsPlatform/FrendsTaskTemplate</PackageProjectUrl>
<PackageTags>dotnet-new;templates;frends</PackageTags>
<TargetFramework>net8.0</TargetFramework>
<PackageReadmeFile>README.md</PackageReadmeFile>

<IncludeContentInPack>true</IncludeContentInPack>
<IncludeBuildOutput>false</IncludeBuildOutput>
<ContentTargetFolders>content</ContentTargetFolders>
<NoDefaultExcludes>true</NoDefaultExcludes>
</PropertyGroup>

<ItemGroup>
<Content Include="Frends.Template\**\*" Exclude="Frends.Template\**\bin\**;Frends.Template\**\obj\**" />
<Compile Remove="**\*" />
<None Include="README.md" Pack="true" PackagePath="\" />
<Content Include="Frends.Template\**\*"
Exclude="Frends.Template\**\bin\**;
Frends.Template\**\obj\**;
Frends.Template\**\.idea\**"/>
<Compile Remove="**\*"/>
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup>

</Project>
Loading