-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Fixed problems. Added IntegrationTests.
- Loading branch information
Showing
5 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/tests/OpenAIGenerator.IntegrationTests/OpenAIGenerator.IntegrationTests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<OpenAIGenerator_ApiKey>$(OPENAI_API_KEY)</OpenAIGenerator_ApiKey> | ||
</PropertyGroup> | ||
|
||
<Import Project="../../libs/OpenAIGenerator/OpenAIGenerator.props" /> | ||
|
||
<ItemGroup Label="Base packages"> | ||
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.0.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" /> | ||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" /> | ||
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" /> | ||
<PackageReference Include="FluentAssertions" Version="6.5.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Label="GlobalUsings"> | ||
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" /> | ||
<Using Include="FluentAssertions" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\libs\OpenAIGenerator\OpenAIGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" /> | ||
</ItemGroup> | ||
|
||
</Project> |
4 changes: 4 additions & 0 deletions
4
src/tests/OpenAIGenerator.IntegrationTests/Prompts/calculator.prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Write simple calculator class in C#. It should have 2 methods: Add and Multiply. | ||
Both methods should take 2 arguments and return result. | ||
You can use only + and * operators. | ||
You can't use any other methods or classes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace H.Ipc.Generator.IntegrationTests; | ||
|
||
[TestClass] | ||
public class NSwagGeneratorTests | ||
{ | ||
[TestMethod] | ||
public void GeneratesClientCorrectly() | ||
{ | ||
var calculator = new Calculator(); | ||
|
||
calculator.Add(1, 1).Should().Be(2); | ||
calculator.Multiply(1, 1).Should().Be(1); | ||
} | ||
} |