diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/WixToolsetTest.Core.Burn/BurnReaderFixture.cs | 44 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.Core.Burn/WixToolsetTest.Core.Burn.csproj | 28 |
2 files changed, 72 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.Core.Burn/BurnReaderFixture.cs b/src/test/WixToolsetTest.Core.Burn/BurnReaderFixture.cs new file mode 100644 index 00000000..a83da7f6 --- /dev/null +++ b/src/test/WixToolsetTest.Core.Burn/BurnReaderFixture.cs | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolsetTest.Core.Burn | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using WixToolset.Core.Burn.Bundles; | ||
| 7 | using Xunit; | ||
| 8 | |||
| 9 | public class BurnReaderFixture | ||
| 10 | { | ||
| 11 | [Fact] | ||
| 12 | public void CanReadUInt16Max() | ||
| 13 | { | ||
| 14 | var bytes = new byte[] { 0xFF, 0xFF }; | ||
| 15 | var offset = 0u; | ||
| 16 | |||
| 17 | var result = BurnCommon.ReadUInt16(bytes, offset); | ||
| 18 | |||
| 19 | Assert.Equal(UInt16.MaxValue, result); | ||
| 20 | } | ||
| 21 | |||
| 22 | [Fact] | ||
| 23 | public void CanReadUInt32Max() | ||
| 24 | { | ||
| 25 | var bytes = new byte[] { 0xFF, 0xFF, 0xFF, 0xFF }; | ||
| 26 | var offset = 0u; | ||
| 27 | |||
| 28 | var result = BurnCommon.ReadUInt32(bytes, offset); | ||
| 29 | |||
| 30 | Assert.Equal(UInt32.MaxValue, result); | ||
| 31 | } | ||
| 32 | |||
| 33 | [Fact] | ||
| 34 | public void CanReadUInt64Max() | ||
| 35 | { | ||
| 36 | var bytes = new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; | ||
| 37 | var offset = 0u; | ||
| 38 | |||
| 39 | var result = BurnCommon.ReadUInt64(bytes, offset); | ||
| 40 | |||
| 41 | Assert.Equal(UInt64.MaxValue, result); | ||
| 42 | } | ||
| 43 | } | ||
| 44 | } | ||
diff --git a/src/test/WixToolsetTest.Core.Burn/WixToolsetTest.Core.Burn.csproj b/src/test/WixToolsetTest.Core.Burn/WixToolsetTest.Core.Burn.csproj new file mode 100644 index 00000000..da0985b1 --- /dev/null +++ b/src/test/WixToolsetTest.Core.Burn/WixToolsetTest.Core.Burn.csproj | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
| 3 | |||
| 4 | <Project Sdk="Microsoft.NET.Sdk"> | ||
| 5 | <PropertyGroup> | ||
| 6 | <TargetFramework>netcoreapp2.1</TargetFramework> | ||
| 7 | <IsPackable>false</IsPackable> | ||
| 8 | <DebugType>embedded</DebugType> | ||
| 9 | </PropertyGroup> | ||
| 10 | |||
| 11 | <PropertyGroup> | ||
| 12 | <NoWarn>NU1701</NoWarn> | ||
| 13 | </PropertyGroup> | ||
| 14 | |||
| 15 | <ItemGroup> | ||
| 16 | <ProjectReference Include="..\..\WixToolset.Core.Burn\WixToolset.Core.Burn.csproj" /> | ||
| 17 | </ItemGroup> | ||
| 18 | |||
| 19 | <ItemGroup> | ||
| 20 | <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.*" /> | ||
| 21 | </ItemGroup> | ||
| 22 | |||
| 23 | <ItemGroup> | ||
| 24 | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" /> | ||
| 25 | <PackageReference Include="xunit" Version="2.4.1" /> | ||
| 26 | <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="All" /> | ||
| 27 | </ItemGroup> | ||
| 28 | </Project> | ||
