-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtractErrorExceptionTests.cs
More file actions
65 lines (59 loc) · 1.99 KB
/
Copy pathExtractErrorExceptionTests.cs
File metadata and controls
65 lines (59 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using XISOSharp.Models;
namespace XISOSharp.Tests;
/// <summary>
/// Tests for <see cref="ExtractErrorException"/>, verifying that the exception
/// correctly stores the <see cref="ExtractError"/> error code and behaves as
/// a standard exception.
/// </summary>
public class ExtractErrorExceptionTests
{
/// <summary>
/// Verifies that the constructor stores the <see cref="ExtractError.ErrIsoNoFiles"/>
/// error code.
/// </summary>
[Fact]
public void Constructor_StoresErrorCode()
{
ExtractErrorException ex = new(ExtractError.ErrIsoNoFiles);
Assert.Equal(ExtractError.ErrIsoNoFiles, ex.ErrorCode);
}
/// <summary>
/// Verifies that the constructor stores the <see cref="ExtractError.ErrEndOfSector"/>
/// error code.
/// </summary>
[Fact]
public void Constructor_StoresErrorCode_ErrEndOfSector()
{
ExtractErrorException ex = new(ExtractError.ErrEndOfSector);
Assert.Equal(ExtractError.ErrEndOfSector, ex.ErrorCode);
}
/// <summary>
/// Verifies that the constructor stores the <see cref="ExtractError.ErrIsoRewritten"/>
/// error code.
/// </summary>
[Fact]
public void Constructor_StoresErrorCode_ErrIsoRewritten()
{
ExtractErrorException ex = new(ExtractError.ErrIsoRewritten);
Assert.Equal(ExtractError.ErrIsoRewritten, ex.ErrorCode);
}
/// <summary>
/// Verifies that <see cref="ExtractErrorException"/> is assignable from <see cref="Exception"/>.
/// </summary>
[Fact]
public void Exception_IsException()
{
ExtractErrorException ex = new(ExtractError.ErrIsoNoFiles);
Assert.IsType<Exception>(ex, exactMatch: false);
}
/// <summary>
/// Verifies that <see cref="ExtractErrorException"/> has a non-null
/// <see cref="Exception.Message"/>.
/// </summary>
[Fact]
public void Exception_HasMessage()
{
ExtractErrorException ex = new(ExtractError.ErrIsoNoFiles);
Assert.NotNull(ex.Message);
}
}