Skip to content

Commit 09d56ba

Browse files
author
Michael Catanzariti
committed
fix auto tests
* Splitted automated tests in 2 projects
1 parent 780e27b commit 09d56ba

File tree

8 files changed

+81
-12
lines changed

8 files changed

+81
-12
lines changed

src/Dahomey.Cbor.Tests/CborInputFormatterTests.cs renamed to src/Dahomey.Cbor.AspNetCore.Tests/CborInputFormatterTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using Dahomey.Cbor.AspNetCore;
2-
using Microsoft.AspNetCore.Http;
1+
using Microsoft.AspNetCore.Http;
32
using Microsoft.AspNetCore.Mvc.ApiExplorer;
43
using Microsoft.AspNetCore.Mvc.Formatters;
54
using Microsoft.AspNetCore.Mvc.ModelBinding;
@@ -11,7 +10,7 @@
1110
using System.IO;
1211
using System.Threading.Tasks;
1312

14-
namespace Dahomey.Cbor.Tests
13+
namespace Dahomey.Cbor.AspNetCore.Tests
1514
{
1615
[TestClass]
1716
public class CborInputFormatterTests

src/Dahomey.Cbor.Tests/CborOutputFormatterTests.cs renamed to src/Dahomey.Cbor.AspNetCore.Tests/CborOutputFormatterTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using Dahomey.Cbor.AspNetCore;
2-
using Microsoft.AspNetCore.Http;
1+
using Microsoft.AspNetCore.Http;
32
using Microsoft.AspNetCore.Mvc.Formatters;
43
using Microsoft.AspNetCore.Mvc.ModelBinding;
54
using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata;
@@ -9,7 +8,7 @@
98
using System.IO;
109
using System.Threading.Tasks;
1110

12-
namespace Dahomey.Cbor.Tests
11+
namespace Dahomey.Cbor.AspNetCore.Tests
1312
{
1413
[TestClass]
1514
public class CborOuputFormatterTests
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
11+
<PackageReference Include="Moq" Version="4.12.0" />
12+
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
13+
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<ProjectReference Include="..\Dahomey.Cbor.AspNetCore\Dahomey.Cbor.AspNetCore.csproj" />
18+
</ItemGroup>
19+
20+
</Project>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
3+
namespace Dahomey.Cbor.AspNetCore.Tests
4+
{
5+
public enum EnumTest
6+
{
7+
None = 0,
8+
Value1 = 1,
9+
Value2 = 2,
10+
}
11+
12+
public class SimpleObject
13+
{
14+
public bool Boolean { get; set; }
15+
public sbyte SByte { get; set; }
16+
public byte Byte { get; set; }
17+
public ushort Int16 { get; set; }
18+
public short UInt16 { get; set; }
19+
public int Int32 { get; set; }
20+
public uint UInt32 { get; set; }
21+
public long Int64 { get; set; }
22+
public ulong UInt64 { get; set; }
23+
public string String { get; set; }
24+
public float Single { get; set; }
25+
public double Double { get; set; }
26+
public DateTime DateTime { get; set; }
27+
public EnumTest Enum { get; set; }
28+
}
29+
30+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System.Linq;
2+
3+
namespace System
4+
{
5+
public static class StringExtensions
6+
{
7+
public static byte[] HexToBytes(this string hexBuffer)
8+
{
9+
return hexBuffer
10+
.Select((c, i) => new { c, i })
11+
.GroupBy(a => a.i / 2)
12+
.Select(grp => new string(grp.Select(g => g.c).ToArray()))
13+
.Select(value => Convert.ToByte(value, 16)).ToArray();
14+
}
15+
}
16+
}

src/Dahomey.Cbor.AspNetCore/Dahomey.Cbor.AspNetCore.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>netcoreapp2.2</TargetFramework>
55
<Version>1.0.3</Version>
66
<Authors>Michaël Catanzariti</Authors>
7-
<Description>ASP.NET Core MVC features that use Daohmye.Cbor. Includes input and output formatters for CBOR</Description>
7+
<Description>ASP.NET Core MVC features that use Dahomey.Cbor. Includes input and output formatters for CBOR</Description>
88
<PackageLicenseExpression>MIT</PackageLicenseExpression>
99
<Company>Dahomey Technologies</Company>
1010
<Copyright>Copyright © Dahomey Technologies 2019</Copyright>
@@ -25,7 +25,7 @@
2525
</ItemGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="Dahomey.Cbor" Version="$(Version)" />
28+
<PackageReference Include="Dahomey.Cbor" Version="1.0.3" />
2929
</ItemGroup>
3030

3131
</Project>

src/Dahomey.Cbor.Tests/Dahomey.Cbor.Tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
</ItemGroup>
1919

2020
<ItemGroup>
21-
<ProjectReference Include="..\Dahomey.Cbor.AspNetCore\Dahomey.Cbor.AspNetCore.csproj" />
2221
<ProjectReference Include="..\Dahomey.Cbor\Dahomey.Cbor.csproj" />
2322
</ItemGroup>
2423

src/Dahomey.Cbor.sln

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.29025.244
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.28307.329
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dahomey.Cbor", "Dahomey.Cbor\Dahomey.Cbor.csproj", "{89C2C751-0FB3-4CC1-B533-DB66213C7890}"
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dahomey.Cbor.Tests", "Dahomey.Cbor.Tests\Dahomey.Cbor.Tests.csproj", "{F95D4310-F3CC-4485-8568-7B3B5DAB81EC}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dahomey.Cbor.AspNetCore", "Dahomey.Cbor.AspNetCore\Dahomey.Cbor.AspNetCore.csproj", "{1AB611C5-333F-4050-83B2-918E8F33B455}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dahomey.Cbor.AspNetCore", "Dahomey.Cbor.AspNetCore\Dahomey.Cbor.AspNetCore.csproj", "{1AB611C5-333F-4050-83B2-918E8F33B455}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dahomey.Cbor.AspNetCore.Tests", "Dahomey.Cbor.AspNetCore.Tests\Dahomey.Cbor.AspNetCore.Tests.csproj", "{61AFA1A1-F0EC-4BCE-8B66-B53EB6DE0EC7}"
1113
EndProject
1214
Global
1315
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -27,6 +29,10 @@ Global
2729
{1AB611C5-333F-4050-83B2-918E8F33B455}.Debug|Any CPU.Build.0 = Debug|Any CPU
2830
{1AB611C5-333F-4050-83B2-918E8F33B455}.Release|Any CPU.ActiveCfg = Release|Any CPU
2931
{1AB611C5-333F-4050-83B2-918E8F33B455}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{61AFA1A1-F0EC-4BCE-8B66-B53EB6DE0EC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{61AFA1A1-F0EC-4BCE-8B66-B53EB6DE0EC7}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{61AFA1A1-F0EC-4BCE-8B66-B53EB6DE0EC7}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{61AFA1A1-F0EC-4BCE-8B66-B53EB6DE0EC7}.Release|Any CPU.Build.0 = Release|Any CPU
3036
EndGlobalSection
3137
GlobalSection(SolutionProperties) = preSolution
3238
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)