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

Upgrade project to .NET Standard 2.0 #5

Merged
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
20 changes: 10 additions & 10 deletions NVelocity.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2042
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NVelocity", "src\NVelocity\NVelocity.csproj", "{E7B5F916-2E69-4BC4-BED9-3141327D7730}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NVelocity", "src\NVelocity\NVelocity.csproj", "{79A9E773-83C9-461B-8373-57439AA28A1A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NVelocity.Tests", "src\NVelocity.Tests\NVelocity.Tests.csproj", "{83D27619-C248-4EA5-9646-5B5CCD8E6B17}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NVelocity.Tests", "src\NVelocity.Tests\NVelocity.Tests.csproj", "{FCB6BF26-25C1-4E45-A506-FD4343B03CF9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E7B5F916-2E69-4BC4-BED9-3141327D7730}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E7B5F916-2E69-4BC4-BED9-3141327D7730}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7B5F916-2E69-4BC4-BED9-3141327D7730}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7B5F916-2E69-4BC4-BED9-3141327D7730}.Release|Any CPU.Build.0 = Release|Any CPU
{83D27619-C248-4EA5-9646-5B5CCD8E6B17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{83D27619-C248-4EA5-9646-5B5CCD8E6B17}.Debug|Any CPU.Build.0 = Debug|Any CPU
{83D27619-C248-4EA5-9646-5B5CCD8E6B17}.Release|Any CPU.ActiveCfg = Release|Any CPU
{83D27619-C248-4EA5-9646-5B5CCD8E6B17}.Release|Any CPU.Build.0 = Release|Any CPU
{79A9E773-83C9-461B-8373-57439AA28A1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79A9E773-83C9-461B-8373-57439AA28A1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79A9E773-83C9-461B-8373-57439AA28A1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79A9E773-83C9-461B-8373-57439AA28A1A}.Release|Any CPU.Build.0 = Release|Any CPU
{FCB6BF26-25C1-4E45-A506-FD4343B03CF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FCB6BF26-25C1-4E45-A506-FD4343B03CF9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FCB6BF26-25C1-4E45-A506-FD4343B03CF9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FCB6BF26-25C1-4E45-A506-FD4343B03CF9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
28 changes: 21 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
image: Visual Studio 2017
image:
- Visual Studio 2017
- Ubuntu

skip_tags: false

before_build:
- nuget restore
init:
- ps: >-
if ($env:APPVEYOR_REPO_TAG -eq "true")
{
Update-AppveyorBuild -Version ($env:APPVEYOR_REPO_TAG_NAME).TrimStart("v")
}

build:
verbosity: minimal
project: NVelocity.sln
publish_nuget: false
build_script:
- dotnet build ./NVelocity.sln -c Release
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read through the Core project and it seemed a little bit overkill (for now) to pull everything into a separate build file, and I was having trouble running it on Ubuntu. So I just put it in here for now.


test_script:
- dotnet test ./src/NVelocity.Tests

artifacts:
- path: build/*.nupkg
name: nvelocity

6 changes: 0 additions & 6 deletions src/NVelocity.Tests/App.config

This file was deleted.

2 changes: 1 addition & 1 deletion src/NVelocity.Tests/ArithmeticExpressionTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class ArithmeticExpressionTestCase
private VelocityEngine velocityEngine;
private VelocityContext context;

[TestFixtureSetUp]
[SetUp]
public void BeforeAnyTest()
{
velocityEngine = new VelocityEngine();
Expand Down
15 changes: 3 additions & 12 deletions src/NVelocity.Tests/Bugs/NVelocity14.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace NVelocity.Tests.Bugs
[TestFixture]
public class NVelocity14 : BaseTestCase
{
[Test, ExpectedException(typeof(ParseErrorException))]
[Test]
public void Test()
{
var velocityEngine = new VelocityEngine();
Expand All @@ -35,17 +35,8 @@ public void Test()
extendedProperties.SetProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, TemplateTest.FILE_RESOURCE_LOADER_PATH);

velocityEngine.Init(extendedProperties);

VelocityContext context = new VelocityContext();

Template template = velocityEngine.GetTemplate(
GetFileName(null, "nv14", TemplateTest.TMPL_FILE_EXT));

StringWriter writer = new StringWriter();

template.Merge(context, writer);

Console.WriteLine(writer);

Assert.Throws<ParseErrorException>(() => velocityEngine.GetTemplate(GetFileName(null, "nv14", TemplateTest.TMPL_FILE_EXT)));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When converting to NUnit 3, I had to rewrite the test because of the removal of ExpectedException

The test actually fails with the expected exception when calling GetTemplate, so everything under that was never run. I just removed it since it didn't seem necessary.

}
}
}
Loading