Updated code to correclty support and compile using .NET Core RC4 (and Visual Studio 2017). May break compatibility with VS2015. Older .NET Core will not be supported. Fixes #13

Signed-off-by: Natalia Portillo <claunia@claunia.com>
This commit is contained in:
2017-02-22 21:25:31 +00:00
parent c646d1beb2
commit e071148e2b
15 changed files with 157 additions and 325 deletions

View File

@@ -1,3 +1,17 @@
2017-02-22 Natalia Portillo <claunia@claunia.com>
* Properties/AssemblyInfo.cs:
Removed, no longer needed in .NET Core.
* plist-cil.test.csproj:
Updated for .NET Core
* NSNumberTests.cs:
Cannot test different locales with NUnit in .NET Core currently.
* PropertyListParserTests.cs:
Use different way to test for exceptions compatible with NUnit 3.6 and .NET Core.
2015-02-24 Natalia Portillo <claunia@claunia.com>
* plist-cil.test.csproj:

View File

@@ -27,6 +27,7 @@ namespace plistcil.test
// <key>TimeZoneOffsetFromUTC</key>
// <real>7200.000000</real>
#if !NETCORE
[Test]
[SetCulture("en-US")]
public static void ParseNumberEnTest()
@@ -71,5 +72,6 @@ namespace plistcil.test
Assert.IsTrue(number.isReal());
Assert.AreEqual(7200d, number.ToDouble());
}
#endif
}
}

View File

@@ -1,51 +0,0 @@
// plist-cil - An open source library to parse and generate property lists for .NET
// Copyright (C) 2015 Natalia Portillo
//
// This code is based on:
// plist - An open source library to parse and generate property lists
// Copyright (C) 2014 Daniel Dreibrodt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("plist-cil.test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Claunia.com")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("© Claunia.com")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

View File

@@ -8,8 +8,12 @@ namespace plistcil.test
public class PropertyListParserTests
{
[Test]
[ExpectedException(typeof(PropertyListFormatException))]
public static void ParseEmptyStreamTest()
{
Assert.Throws<PropertyListFormatException>(new TestDelegate(ParseEmptyStreamTestDelegate));
}
static void ParseEmptyStreamTestDelegate()
{
using (MemoryStream stream = new MemoryStream())
{

View File

@@ -1,51 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{36AD4394-6A31-465F-BE8E-E4806A89CC38}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>plistcil.test</RootNamespace>
<AssemblyName>plist-cil.test</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<ReleaseVersion>1.14</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<TargetFrameworks>netcoreapp1.0;net40</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
<PackageReference Include="NUnit" Version="3.6.0" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp1.0'">
<DefineConstants>NETCOREAPP1_0;NETCORE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="NSArrayTests.cs" />
<Compile Include="NSNumberTests.cs" />
<Compile Include="NSDateTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ParseTest.cs" />
<Compile Include="IssueTest.cs" />
<Compile Include="PropertyListParserTests.cs" />
<ProjectReference Include="..\plist-cil\plist-cil.csproj" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<None Include="packages.config" />
<None Include="..\test-files\test1-ascii-gnustep.plist">
<Link>test-files\test1-ascii-gnustep.plist</Link>
<Gettext-ScanForTranslations>False</Gettext-ScanForTranslations>
@@ -123,14 +94,5 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\plist-cil\plist-cil.csproj">
<Project>{5EA40CD5-CB98-4FD5-8628-3B399EACB38B}</Project>
<Name>plist-cil</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
</Project>
</Project>