From 300a4bd03cbeb646af762371ffa71e9241c1302a Mon Sep 17 00:00:00 2001 From: Andrew Wilkinson Date: Sat, 4 Mar 2017 12:05:14 +0000 Subject: [PATCH] Make Tiff implementation details internal --- src/ImageSharp.Formats.Tiff/AssemblyInfo.cs | 11 +++++++++++ src/ImageSharp.Formats.Tiff/TiffTags.cs | 2 +- src/ImageSharp.Formats.Tiff/TiffType.cs | 2 +- .../TestUtilities/Tiff/ITiffGenDataSource.cs | 2 +- .../TestUtilities/Tiff/TiffGenDataBlock.cs | 2 +- .../TestUtilities/Tiff/TiffGenDataReference.cs | 2 +- .../TestUtilities/Tiff/TiffGenEntry.cs | 2 +- .../TestUtilities/Tiff/TiffGenExtensions.cs | 2 +- .../TestUtilities/Tiff/TiffGenHeader.cs | 2 +- .../TestUtilities/Tiff/TiffGenIfd.cs | 2 +- 10 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 src/ImageSharp.Formats.Tiff/AssemblyInfo.cs diff --git a/src/ImageSharp.Formats.Tiff/AssemblyInfo.cs b/src/ImageSharp.Formats.Tiff/AssemblyInfo.cs new file mode 100644 index 000000000..4d1cbfe55 --- /dev/null +++ b/src/ImageSharp.Formats.Tiff/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; + +// Ensure the internals can be tested. +[assembly: InternalsVisibleTo("ImageSharp.Formats.Tiff.Tests")] \ No newline at end of file diff --git a/src/ImageSharp.Formats.Tiff/TiffTags.cs b/src/ImageSharp.Formats.Tiff/TiffTags.cs index db4087d58..41721fb1d 100644 --- a/src/ImageSharp.Formats.Tiff/TiffTags.cs +++ b/src/ImageSharp.Formats.Tiff/TiffTags.cs @@ -8,7 +8,7 @@ namespace ImageSharp.Formats /// /// Constants representing tag IDs in the Tiff file-format. /// - public class TiffTags + internal class TiffTags { // Section 8: Baseline Fields diff --git a/src/ImageSharp.Formats.Tiff/TiffType.cs b/src/ImageSharp.Formats.Tiff/TiffType.cs index 1bb7f6cfb..b98236c0f 100644 --- a/src/ImageSharp.Formats.Tiff/TiffType.cs +++ b/src/ImageSharp.Formats.Tiff/TiffType.cs @@ -8,7 +8,7 @@ namespace ImageSharp.Formats /// /// Enumeration representing the data types understood by the Tiff file-format. /// - public enum TiffType + internal enum TiffType { Byte = 1, Ascii = 2, diff --git a/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/ITiffGenDataSource.cs b/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/ITiffGenDataSource.cs index 33bf99924..1c8a485b9 100644 --- a/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/ITiffGenDataSource.cs +++ b/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/ITiffGenDataSource.cs @@ -11,7 +11,7 @@ namespace ImageSharp.Tests /// /// An interface for any class within the Tiff generator that produces data to be included in the file. /// - public interface ITiffGenDataSource + internal interface ITiffGenDataSource { IEnumerable GetData(bool isLittleEndian); } diff --git a/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenDataBlock.cs b/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenDataBlock.cs index bbce12054..6a91dbbcc 100644 --- a/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenDataBlock.cs +++ b/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenDataBlock.cs @@ -12,7 +12,7 @@ namespace ImageSharp.Tests /// A utility data structure to represent an independent block of data in a Tiff file. /// These may be located in any order within a Tiff file. /// - public class TiffGenDataBlock + internal class TiffGenDataBlock { public TiffGenDataBlock(byte[] bytes) { diff --git a/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenDataReference.cs b/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenDataReference.cs index ec4c0c5df..90cacb23d 100644 --- a/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenDataReference.cs +++ b/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenDataReference.cs @@ -11,7 +11,7 @@ namespace ImageSharp.Tests /// /// A utility data structure to represent a reference from one block of data to another in a Tiff file. /// - public class TiffGenDataReference + internal class TiffGenDataReference { public TiffGenDataReference(byte[] bytes, int offset) { diff --git a/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenEntry.cs b/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenEntry.cs index 4f0ff868b..df61b4d8a 100644 --- a/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenEntry.cs +++ b/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenEntry.cs @@ -14,7 +14,7 @@ namespace ImageSharp.Tests /// /// A utility data structure to represent Tiff IFD entries in unit tests. /// - public abstract class TiffGenEntry : ITiffGenDataSource + internal abstract class TiffGenEntry : ITiffGenDataSource { private TiffGenEntry(ushort tag, TiffType type) { diff --git a/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenExtensions.cs b/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenExtensions.cs index 87ba62121..21c3b0844 100644 --- a/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenExtensions.cs +++ b/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenExtensions.cs @@ -12,7 +12,7 @@ namespace ImageSharp.Tests /// /// A utility class for generating in-memory Tiff files for use in unit tests. /// - public static class TiffGenExtensions + internal static class TiffGenExtensions { public static byte[] ToBytes(this ITiffGenDataSource dataSource, bool isLittleEndian) { diff --git a/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenHeader.cs b/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenHeader.cs index 95322dc66..b28ceedc2 100644 --- a/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenHeader.cs +++ b/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenHeader.cs @@ -12,7 +12,7 @@ namespace ImageSharp.Tests /// /// A utility data structure to represent a Tiff file-header. /// - public class TiffGenHeader : ITiffGenDataSource + internal class TiffGenHeader : ITiffGenDataSource { public TiffGenHeader() { diff --git a/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenIfd.cs b/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenIfd.cs index 2e745df36..c26a0f199 100644 --- a/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenIfd.cs +++ b/tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenIfd.cs @@ -12,7 +12,7 @@ namespace ImageSharp.Tests /// /// A utility data structure to represent Tiff IFDs in unit tests. /// - public class TiffGenIfd : ITiffGenDataSource + internal class TiffGenIfd : ITiffGenDataSource { public TiffGenIfd() {