-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small unit tests + light refacto + bump version
- Loading branch information
Showing
10 changed files
with
86 additions
and
80 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
Substrate.NET.Metadata.Tests/Conversion/ConversionUtilsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
using Substrate.NET.Metadata.Conversion.Internal; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Substrate.NET.Metadata.Tests.Conversion | ||
{ | ||
internal class ConversionUtilsTests | ||
{ | ||
[Test] | ||
public void EndsWithArray_ShouldReturnTrue() | ||
{ | ||
var array1 = new[] { 1, 2, 3, 4, 5 }; | ||
var array2 = new[] { 4, 5 }; | ||
|
||
var result = ConversionUtils.EndsWithArray(array1, array2); | ||
|
||
Assert.That(result); | ||
} | ||
|
||
[Test] | ||
public void EndsWithArray_ShouldReturnFalse() | ||
{ | ||
var array1 = new[] { 1, 2, 3, 4, 5 }; | ||
var array2 = new[] { 4, 6 }; | ||
|
||
var result = ConversionUtils.EndsWithArray(array1, array2); | ||
|
||
Assert.That(result, Is.False); | ||
} | ||
|
||
[Test] | ||
public void AreArraysIdentical_WhenEquals_ShouldReturnTrue() | ||
{ | ||
var array1 = new[] { 1, 2, 3, 4, 5 }; | ||
var array2 = new[] { 1, 2, 3, 4, 5 }; | ||
|
||
var result = ConversionUtils.AreArraysIdentical(array1, array2); | ||
|
||
Assert.That(result); | ||
} | ||
|
||
[Test] | ||
public void AreArraysIdentical_WhenNotSameSize_ShouldReturnFalse() | ||
{ | ||
var array1 = new[] { 1, 2, 3, 4, 5 }; | ||
var array2 = new[] { 1, 2, 3, 4 }; | ||
|
||
var result = ConversionUtils.AreArraysIdentical(array1, array2); | ||
|
||
Assert.That(result, Is.False); | ||
} | ||
|
||
[Test] | ||
public void AreArraysIdentical_WhenDifferent_ShouldReturnFalse() | ||
{ | ||
var array1 = new[] { 1, 2, 3, 4, 5 }; | ||
var array2 = new[] { 1, 2, 3, 4, 6 }; | ||
|
||
var result = ConversionUtils.AreArraysIdentical(array1, array2); | ||
|
||
Assert.That(result, Is.False); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters