This repository was archived by the owner on Aug 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
src/OpenSource.Data.HashFunction.Test/Blake3 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Security . Cryptography ;
4+ using System . Text ;
5+ using Xunit ;
6+ using OpenSource . Data . HashFunction . Blake3 ;
7+
8+ namespace OpenSource . Data . HashFunction . Test . Blake3
9+ {
10+ public class Blake3Config_Tests
11+ {
12+ [ Fact ]
13+ public void Blake3Config_Defaults_HaventChanged ( )
14+ {
15+ var blake3Config = new Blake3Config ( ) ;
16+
17+ Assert . Equal ( Blake3Config . DefaultHashSizeInBits , blake3Config . HashSizeInBits ) ;
18+ }
19+
20+ [ Fact ]
21+ public void Blake3Config_Clone_Works ( )
22+ {
23+ var blake3Config = new Blake3Config ( ) {
24+ HashSizeInBits = 64 ,
25+ } ;
26+
27+ var blake3ConfigClone = blake3Config . Clone ( ) ;
28+
29+ Assert . IsType < Blake3Config > ( blake3ConfigClone ) ;
30+
31+ Assert . Equal ( blake3Config . HashSizeInBits , blake3ConfigClone . HashSizeInBits ) ;
32+ }
33+ }
34+ }
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Security . Cryptography ;
4+ using System . Text ;
5+ using Xunit ;
6+ using OpenSource . Data . HashFunction . Blake3 ;
7+
8+ namespace OpenSource . Data . HashFunction . Test . Blake3
9+ {
10+ public class Blake3Factory_Tests
11+ {
12+ [ Fact ]
13+ public void Blake3Factory_Instance_IsDefined ( )
14+ {
15+ Assert . NotNull ( Blake3Factory . Instance ) ;
16+ Assert . IsType < Blake3Factory > ( Blake3Factory . Instance ) ;
17+ }
18+
19+ [ Fact ]
20+ public void blake3Factory_Create_Config_IsNull_Throws ( )
21+ {
22+ var blake3Factory = Blake3Factory . Instance ;
23+
24+ Assert . Equal (
25+ "config" ,
26+ Assert . Throws < ArgumentNullException > (
27+ ( ) => blake3Factory . Create ( null ) )
28+ . ParamName ) ;
29+ }
30+
31+ [ Fact ]
32+ public void blake3Factory_Create_Config_Works ( )
33+ {
34+ var blake3Config = new Blake3Config ( ) ;
35+
36+ var blake3Factory = Blake3Factory . Instance ;
37+ var blake3 = blake3Factory . Create ( blake3Config ) ;
38+
39+ Assert . NotNull ( blake3 ) ;
40+ Assert . IsType < Blake3_Implementation > ( blake3 ) ;
41+
42+ var resultingBlake3Config = blake3 . Config ;
43+
44+ Assert . Equal ( resultingBlake3Config . HashSizeInBits , resultingBlake3Config . HashSizeInBits ) ;
45+ Assert . Equal ( resultingBlake3Config , resultingBlake3Config ) ;
46+ }
47+ }
48+ }
You can’t perform that action at this time.
0 commit comments