1
+ #region License
2
+
3
+ //
4
+ // Copyright 2002-2015 Drew Noakes
5
+ // Ported from Java to C# by Yakov Danilov for Imazen LLC in 2014
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+ //
19
+ // More information about this project is available at:
20
+ //
21
+ // https://github.com/drewnoakes/metadata-extractor-dotnet
22
+ // https://drewnoakes.com/code/exif/
23
+ //
24
+
25
+ #endregion
26
+
27
+ using MetadataExtractor . Util ;
28
+ using Xunit ;
29
+
30
+ namespace MetadataExtractor . Tests . Util
31
+ {
32
+ public class ByteConvertTest
33
+ {
34
+ [ Fact ]
35
+ public void ToInt32BigEndian ( )
36
+ {
37
+ Assert . Equal ( 0x01020304 , ByteConvert . ToInt32BigEndian ( new byte [ ] { 1 , 2 , 3 , 4 } ) ) ;
38
+ Assert . Equal ( 0x01020304 , ByteConvert . ToInt32BigEndian ( new byte [ ] { 1 , 2 , 3 , 4 , 5 } ) ) ;
39
+ }
40
+
41
+ [ Fact ]
42
+ public void ToInt32LittleEndian ( )
43
+ {
44
+ Assert . Equal ( 0x04030201 , ByteConvert . ToInt32LittleEndian ( new byte [ ] { 1 , 2 , 3 , 4 } ) ) ;
45
+ Assert . Equal ( 0x04030201 , ByteConvert . ToInt32LittleEndian ( new byte [ ] { 1 , 2 , 3 , 4 , 5 } ) ) ;
46
+ }
47
+ }
48
+ }
0 commit comments