Skip to content

Commit aa96da7

Browse files
committed
removing old tests
1 parent 7bdf356 commit aa96da7

1 file changed

Lines changed: 0 additions & 64 deletions

File tree

cas-dotnet-sdk-tests/SHA/SHAWrapperTests.cs

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,19 @@
11
using CasDotnetSdk.Hashers;
2-
using System;
3-
using System.Collections.Generic;
42
using System.Globalization;
5-
using System.IO;
6-
using System.Linq;
7-
using System.Text;
83
using Xunit;
94

105
namespace CasDotnetSdkTests.Tests
116
{
127
public class SHAWrapperTests
138
{
149
private readonly SHAWrapper _wrapper;
15-
private readonly string _testString;
1610
private const string DataDirectory = "SHA/Data";
1711

1812
public SHAWrapperTests()
1913
{
2014
this._wrapper = new SHAWrapper();
2115
}
2216

23-
[Fact]
24-
public void SHA512HashBytes()
25-
{
26-
byte[] data = Encoding.UTF8.GetBytes(this._testString);
27-
byte[] hashed = this._wrapper.Hash512(data);
28-
Assert.NotNull(hashed);
29-
Assert.NotEmpty(hashed);
30-
Assert.True(hashed.Length > 0);
31-
}
32-
33-
[Fact]
34-
public void SHA512VerifyPass()
35-
{
36-
byte[] data = Encoding.UTF8.GetBytes(this._testString);
37-
byte[] hashed = this._wrapper.Hash512(data);
38-
bool isSame = this._wrapper.Verify512(data, hashed);
39-
Assert.True(isSame);
40-
}
41-
42-
[Fact]
43-
public void SHA512VerifyFail()
44-
{
45-
byte[] data = Encoding.UTF8.GetBytes(this._testString);
46-
byte[] hashed = this._wrapper.Hash512(data);
47-
data = Encoding.UTF8.GetBytes("Not the same byte array");
48-
bool isSame = this._wrapper.Verify512(data, hashed);
49-
Assert.False(isSame);
50-
}
51-
52-
[Fact]
53-
public void SHA256HashBytes()
54-
{
55-
byte[] data = Encoding.UTF8.GetBytes(this._testString);
56-
byte[] hashed = this._wrapper.Hash256(data);
57-
Assert.NotNull(hashed);
58-
Assert.NotEmpty(hashed);
59-
Assert.True(hashed.Length > 0);
60-
}
61-
62-
[Fact]
63-
public void SHA256VerifyPass()
64-
{
65-
byte[] data = Encoding.UTF8.GetBytes(this._testString);
66-
byte[] hashed = this._wrapper.Hash256(data);
67-
bool isSame = this._wrapper.Verify256(data, hashed);
68-
Assert.True(isSame);
69-
}
70-
71-
[Fact]
72-
public void SHA256VerifyFail()
73-
{
74-
byte[] data = Encoding.UTF8.GetBytes(this._testString);
75-
byte[] hashed = this._wrapper.Hash256(data);
76-
data = Encoding.UTF8.GetBytes("Not the same byte array");
77-
bool isSame = this._wrapper.Verify256(data, hashed);
78-
Assert.False(isSame);
79-
}
80-
8117
[Theory]
8218
[MemberData(nameof(SHA256NistVectors))]
8319
public void SHA256MatchesNistVectors(byte[] message, byte[] expectedDigest)

0 commit comments

Comments
 (0)