mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
964 B
33 lines
964 B
// Copyright (c) Six Labors and contributors.
|
|
// Licensed under the Apache License, Version 2.0.
|
|
|
|
using System.IO;
|
|
|
|
using SixLabors.ImageSharp.Formats;
|
|
|
|
using Xunit;
|
|
|
|
namespace SixLabors.ImageSharp.Tests.Formats.Tga
|
|
{
|
|
public class TgaFileHeaderTests
|
|
{
|
|
private static readonly byte[] Data = {
|
|
0,
|
|
0,
|
|
15 // invalid tga image type
|
|
};
|
|
|
|
private MemoryStream Stream { get; } = new MemoryStream(Data);
|
|
|
|
[Fact]
|
|
public void ImageLoad_WithInvalidImageType_Throws_UnknownImageFormatException()
|
|
{
|
|
Assert.Throws<UnknownImageFormatException>(() =>
|
|
{
|
|
using (Image.Load(Configuration.Default, this.Stream, out IImageFormat _))
|
|
{
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|