Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from head #1

Merged
merged 17 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,5 @@ paket-files/
/src/TypeGen/TypeGen.Cli/NuGet.config
/src/TypeGen/TypeGen.Core/TypeGen.Core.xml
generated-typescript
/src/TypeGen/TypeGen.Core.Test/foo.ts
/src/TypeGen/TypeGen.Core.Test/tgconfig.json
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ before_build:
- dotnet restore src/TypeGen/TypeGen.Core
- dotnet restore src/TypeGen/TypeGen.Cli.Test
- dotnet restore src/TypeGen/TypeGen.Core.Test
- dotnet restore src/TypeGen/TypeGen.IntegrationTest
- dotnet restore src/TypeGen/TypeGen.FileContentTest

build:
project: src/TypeGen/TypeGen.sln
Expand Down
6 changes: 4 additions & 2 deletions nuget-dotnetcli/dotnet-typegen.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>dotnet-typegen</id>
<version>4.4.1</version>
<version>4.5.0</version>
<authors>Jacek Burzynski</authors>
<owners>Jacek Burzynski</owners>
<license type="file">LICENSE</license>
Expand All @@ -11,7 +11,9 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>TypeGen .NET Core CLI tool (TypeGen is a single-class-per-file C# to TypeScript generator)</description>
<releaseNotes>
- fixed exportTypesAsInterfacesByDefault and useImportType not working in tgconfig.json
- added the ability to blacklist/whitelist individual types (this also fixes records not generating correctly #164)
- TS class : TS interface inheritance is now possible - in this case TS class implements TS interface
- added the ability to specify custom header and body as an attribute or spec #166 #167
</releaseNotes>
<tags>code-generator generator code typescript ts csharp cs dotnet cli</tags>
<packageTypes>
Expand Down
6 changes: 4 additions & 2 deletions nuget/TypeGen.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>TypeGen</id>
<version>4.4.1</version>
<version>4.5.0</version>
<authors>Jacek Burzynski</authors>
<owners>Jacek Burzynski</owners>
<license type="file">LICENSE</license>
Expand All @@ -11,7 +11,9 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>TypeGen is a single-class-per-file C# to TypeScript generator</description>
<releaseNotes>
- fixed exportTypesAsInterfacesByDefault and useImportType not working in tgconfig.json
- added the ability to blacklist/whitelist individual types (this also fixes records not generating correctly #164)
- TS class : TS interface inheritance is now possible - in this case TS class implements TS interface
- added the ability to specify custom header and body as an attribute or spec #166 #167
</releaseNotes>
<tags>code-generator generator code typescript ts csharp cs</tags>
<dependencies>
Expand Down
44 changes: 44 additions & 0 deletions src/TypeGen/TypeGen.Cli.Test/ApplicationTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using NSubstitute;
using TypeGen.Cli.Ui;
using TypeGen.Core.Logging;
using Xunit;

namespace TypeGen.Cli.Test;

public class ApplicationTest
{
[Fact]
public async Task Run_CommandIsGetCwd_CorrectPresenterMethodCalled()
{
// arrange
var args = new[] { "getcwd" };
var logger = Substitute.For<ILogger>();
var presenter = Substitute.For<IPresenter>();
var sut = new Application(logger, presenter);

// act
await sut.Run(args);

// assert
presenter.Received(1).GetCwd();
}

[Fact]
public async Task Run_CommandIsGenerate_CorrectPresenterMethodCalled()
{
// arrange
var args = new[] { "generate" };
var logger = Substitute.For<ILogger>();
var presenter = Substitute.For<IPresenter>();
var sut = new Application(logger, presenter);

// act
await sut.Run(args);

// assert
presenter.Received(1).Generate(Arg.Any<bool>(), Arg.Any<IReadOnlyCollection<string>>(),
Arg.Any<IReadOnlyCollection<string>>(), Arg.Any<string>());
}
}
234 changes: 0 additions & 234 deletions src/TypeGen/TypeGen.Cli.Test/Business/ConsoleArgsReaderTest.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using FluentAssertions;
using Xunit;

namespace TypeGen.IntegrationTest
namespace TypeGen.Cli.Test
{
public class CliSmokeTest
{
Expand All @@ -16,7 +16,7 @@ public void Cli_should_finish_with_success()
{
// arrange

const string projectToGeneratePath = "../../../../TypeGen.IntegrationTest";
const string projectToGeneratePath = "../../../../TypeGen.FileContentTest";
const string cliFileName = "TypeGen.Cli.exe";
string[] cliPossibleDirectories = {
"../../../../TypeGen.Cli/bin/Debug/net7.0",
Expand Down
Loading