Skip to content

Commit

Permalink
Added additional unit test for operators.
Browse files Browse the repository at this point in the history
  • Loading branch information
amsga committed Dec 30, 2024
1 parent 2fe6426 commit aa31e7b
Show file tree
Hide file tree
Showing 2 changed files with 204 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup .NET 8
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
Expand Down
202 changes: 202 additions & 0 deletions XUnitTestProjectUUID/UnitTestUuid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,5 +321,207 @@ public void TestToString7()

Assert.Throws<FormatException>(() => { uuid.ToString("C"); });
}

[Fact]
public void TestOperatorEquals1()
{
object other = new object();
string vs = "7d444840-9dc0-11d1-b245-5ffdce74fad2";
TensionDev.UUID.Uuid uuid = TensionDev.UUID.Uuid.Parse(vs);

bool actualResult = uuid == other;
Assert.False(actualResult);
}

[Fact]
public void TestOperatorEquals2()
{
string vs = "{7d444840-9dc0-11d1-b245-5ffdce74fad2}";
TensionDev.UUID.Uuid uuid1 = TensionDev.UUID.Uuid.Parse(vs);
TensionDev.UUID.Uuid uuid2 = TensionDev.UUID.Uuid.Parse(vs);

bool actualResult = uuid1 == uuid2;
Assert.True(actualResult);
}

[Fact]
public void TestOperatorEquals3()
{
TensionDev.UUID.Uuid other = null;
string vs = "7d444840-9dc0-11d1-b245-5ffdce74fad2";
TensionDev.UUID.Uuid uuid = TensionDev.UUID.Uuid.Parse(vs);

bool actualResult = uuid == other;
Assert.False(actualResult);
}

[Fact]
public void TestOperatorNotEquals1()
{
object other = new object();
string vs = "7d444840-9dc0-11d1-b245-5ffdce74fad2";
TensionDev.UUID.Uuid uuid = TensionDev.UUID.Uuid.Parse(vs);

bool actualResult = uuid != other;
Assert.True(actualResult);
}

[Fact]
public void TestOperatorNotEquals2()
{
string vs = "{7d444840-9dc0-11d1-b245-5ffdce74fad2}";
TensionDev.UUID.Uuid uuid1 = TensionDev.UUID.Uuid.Parse(vs);
TensionDev.UUID.Uuid uuid2 = TensionDev.UUID.Uuid.Parse(vs);

bool actualResult = uuid1 != uuid2;
Assert.False(actualResult);
}

[Fact]
public void TestOperatorNotEquals3()
{
TensionDev.UUID.Uuid other = null;
string vs = "7d444840-9dc0-11d1-b245-5ffdce74fad2";
TensionDev.UUID.Uuid uuid = TensionDev.UUID.Uuid.Parse(vs);

bool actualResult = uuid != other;
Assert.True(actualResult);
}

[Fact]
public void TestOperatorLessThan1()
{
string vs1 = "7d444830-9dc0-11d1-b245-5ffdce74fad2";
string vs2 = "7d444840-9dc0-11d1-b245-5ffdce74fad2";
TensionDev.UUID.Uuid uuid1 = TensionDev.UUID.Uuid.Parse(vs1);
TensionDev.UUID.Uuid uuid2 = TensionDev.UUID.Uuid.Parse(vs2);

bool actualResult = uuid1 < uuid2;
Assert.True(actualResult);
}

[Fact]
public void TestOperatorLessThan2()
{
string vs = "{7d444840-9dc0-11d1-b245-5ffdce74fad2}";
TensionDev.UUID.Uuid uuid1 = TensionDev.UUID.Uuid.Parse(vs);
TensionDev.UUID.Uuid uuid2 = TensionDev.UUID.Uuid.Parse(vs);

bool actualResult = uuid1 < uuid2;
Assert.False(actualResult);
}

[Fact]
public void TestOperatorLessThan3()
{
TensionDev.UUID.Uuid other = null;
string vs = "7d444840-9dc0-11d1-b245-5ffdce74fad2";
TensionDev.UUID.Uuid uuid = TensionDev.UUID.Uuid.Parse(vs);

bool actualResult = uuid < other;
Assert.False(actualResult);
}

[Fact]
public void TestOperatorGreaterThan1()
{
string vs1 = "7d444830-9dc0-11d1-b245-5ffdce74fad2";
string vs2 = "7d444840-9dc0-11d1-b245-5ffdce74fad2";
TensionDev.UUID.Uuid uuid1 = TensionDev.UUID.Uuid.Parse(vs1);
TensionDev.UUID.Uuid uuid2 = TensionDev.UUID.Uuid.Parse(vs2);

bool actualResult = uuid1 > uuid2;
Assert.False(actualResult);
}

[Fact]
public void TestOperatorGreaterThan2()
{
string vs = "{7d444840-9dc0-11d1-b245-5ffdce74fad2}";
TensionDev.UUID.Uuid uuid1 = TensionDev.UUID.Uuid.Parse(vs);
TensionDev.UUID.Uuid uuid2 = TensionDev.UUID.Uuid.Parse(vs);

bool actualResult = uuid1 > uuid2;
Assert.False(actualResult);
}

[Fact]
public void TestOperatorGreaterThan3()
{
TensionDev.UUID.Uuid other = null;
string vs = "7d444840-9dc0-11d1-b245-5ffdce74fad2";
TensionDev.UUID.Uuid uuid = TensionDev.UUID.Uuid.Parse(vs);

bool actualResult = uuid > other;
Assert.True(actualResult);
}

[Fact]
public void TestOperatorLessThanOrEqual1()
{
string vs1 = "7d444830-9dc0-11d1-b245-5ffdce74fad2";
string vs2 = "7d444840-9dc0-11d1-b245-5ffdce74fad2";
TensionDev.UUID.Uuid uuid1 = TensionDev.UUID.Uuid.Parse(vs1);
TensionDev.UUID.Uuid uuid2 = TensionDev.UUID.Uuid.Parse(vs2);

bool actualResult = uuid1 <= uuid2;
Assert.True(actualResult);
}

[Fact]
public void TestOperatorLessThanOrEqual2()
{
string vs = "{7d444840-9dc0-11d1-b245-5ffdce74fad2}";
TensionDev.UUID.Uuid uuid1 = TensionDev.UUID.Uuid.Parse(vs);
TensionDev.UUID.Uuid uuid2 = TensionDev.UUID.Uuid.Parse(vs);

bool actualResult = uuid1 <= uuid2;
Assert.True(actualResult);
}

[Fact]
public void TestOperatorLessThanOrEqual3()
{
TensionDev.UUID.Uuid other = null;
string vs = "7d444840-9dc0-11d1-b245-5ffdce74fad2";
TensionDev.UUID.Uuid uuid = TensionDev.UUID.Uuid.Parse(vs);

bool actualResult = uuid <= other;
Assert.False(actualResult);
}

[Fact]
public void TestOperatorGreaterThanOrEqual1()
{
string vs1 = "7d444830-9dc0-11d1-b245-5ffdce74fad2";
string vs2 = "7d444840-9dc0-11d1-b245-5ffdce74fad2";
TensionDev.UUID.Uuid uuid1 = TensionDev.UUID.Uuid.Parse(vs1);
TensionDev.UUID.Uuid uuid2 = TensionDev.UUID.Uuid.Parse(vs2);

bool actualResult = uuid1 >= uuid2;
Assert.False(actualResult);
}

[Fact]
public void TestOperatorGreaterThanOrEqual2()
{
string vs = "{7d444840-9dc0-11d1-b245-5ffdce74fad2}";
TensionDev.UUID.Uuid uuid1 = TensionDev.UUID.Uuid.Parse(vs);
TensionDev.UUID.Uuid uuid2 = TensionDev.UUID.Uuid.Parse(vs);

bool actualResult = uuid1 >= uuid2;
Assert.True(actualResult);
}

[Fact]
public void TestOperatorGreaterThanOrEqual3()
{
TensionDev.UUID.Uuid other = null;
string vs = "7d444840-9dc0-11d1-b245-5ffdce74fad2";
TensionDev.UUID.Uuid uuid = TensionDev.UUID.Uuid.Parse(vs);

bool actualResult = uuid >= other;
Assert.True(actualResult);
}
}
}

0 comments on commit aa31e7b

Please sign in to comment.