Skip to content

Commit 8f707f2

Browse files
committed
Add tests for default LightJson exception constructors
1 parent 61f19e4 commit 8f707f2

3 files changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
3+
4+
namespace StyleCop.Analyzers.Test.LightJson.Serialization
5+
{
6+
using global::LightJson.Serialization;
7+
using Xunit;
8+
9+
public class JsonParseExceptionTests
10+
{
11+
[Fact]
12+
public void TestDefaultConstructor()
13+
{
14+
var ex = new JsonParseException();
15+
Assert.Equal(JsonParseException.ErrorType.Unknown, ex.Type);
16+
Assert.False(string.IsNullOrEmpty(ex.Message));
17+
}
18+
}
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
3+
4+
namespace StyleCop.Analyzers.Test.LightJson.Serialization
5+
{
6+
using global::LightJson.Serialization;
7+
using Xunit;
8+
9+
public class JsonSerializationExceptionTests
10+
{
11+
[Fact]
12+
public void TestDefaultConstructor()
13+
{
14+
var ex = new JsonSerializationException();
15+
Assert.Equal(JsonSerializationException.ErrorType.Unknown, ex.Type);
16+
Assert.False(string.IsNullOrEmpty(ex.Message));
17+
}
18+
}
19+
}

StyleCop.Analyzers/StyleCop.Analyzers.Test/StyleCop.Analyzers.Test.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,9 @@
238238
<Compile Include="LightJson\JsonArrayTests.cs" />
239239
<Compile Include="LightJson\JsonObjectTests.cs" />
240240
<Compile Include="LightJson\JsonValueTests.cs" />
241+
<Compile Include="LightJson\Serialization\JsonParseExceptionTests.cs" />
241242
<Compile Include="LightJson\Serialization\JsonReaderTests.cs" />
243+
<Compile Include="LightJson\Serialization\JsonSerializationExceptionTests.cs" />
242244
<Compile Include="LightJson\Serialization\JsonWriterTests.cs" />
243245
<Compile Include="LightJson\Serialization\TextScannerTests.cs" />
244246
<Compile Include="Lightup\AccessorDeclarationSyntaxExtensionsTests.cs" />

0 commit comments

Comments
 (0)