-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathIccUnsupportedFileTests.cs
More file actions
48 lines (39 loc) · 1.49 KB
/
Copy pathIccUnsupportedFileTests.cs
File metadata and controls
48 lines (39 loc) · 1.49 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
using System;
using System.IO;
using NUnit.Framework;
using Wacton.Unicolour.Icc;
namespace Wacton.Unicolour.Tests;
public class IccUnsupportedFileTests : IccUnsupportedTests
{
[TestCase(Source.FromChannels)]
[TestCase(Source.FromRgb)]
public void NotFound(Source source)
{
const string path = "🚫";
Assert.Throws<FileNotFoundException>(() => { _ = new Profile(path); });
var iccConfig = new IccConfiguration(path, Intent.Unspecified, "not found");
AssertNotFound(iccConfig, source);
}
[TestCase(Source.FromChannels)]
[TestCase(Source.FromRgb)]
public void NotEnoughBytes(Source source)
{
const string path = "not_enough_bytes.icc";
File.WriteAllBytes(path, CreateBytes(64));
Assert.Throws<ArgumentException>(() => { _ = new Profile(path); });
var iccConfig = new IccConfiguration(path, Intent.Unspecified, "not enough bytes");
AssertNotEnoughBytes(iccConfig, source);
File.Delete(path);
}
[TestCase(Source.FromChannels)]
[TestCase(Source.FromRgb)]
public void NotParseable(Source source)
{
const string path = "not_parseable.icc";
File.WriteAllBytes(path, CreateBytes(512));
Assert.Throws<ArgumentException>(() => { _ = new Profile(path); });
var iccConfig = new IccConfiguration(path, Intent.Unspecified, "not parseable");
AssertNotParseable(iccConfig, source);
File.Delete(path);
}
}