Skip to content

Commit

Permalink
Add enumerable utils some tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
I-RzR-I committed Jan 9, 2025
1 parent ec39a31 commit 5463c06
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022-2024 RzR
Copyright (c) 2022-2025 RzR

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/shared/GeneralAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

[assembly: AssemblyCompany("RzR ®")]
[assembly: AssemblyProduct("Common data type extensions")]
[assembly: AssemblyCopyright("Copyright © 2022-2024 RzR All rights reserved.")]
[assembly: AssemblyCopyright("Copyright © 2022-2025 RzR All rights reserved.")]
[assembly: AssemblyTrademark("® RzR™")]
[assembly:
AssemblyDescription(
Expand Down
71 changes: 71 additions & 0 deletions src/tests/DataTypeTests/EnumerateUtilsTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// ***********************************************************************
// Assembly : RzR.Shared.Extensions.DataTypeTests
// Author : RzR
// Created On : 2025-01-09 20:50
//
// Last Modified By : RzR
// Last Modified On : 2025-01-09 20:50
// ***********************************************************************
// <copyright file="EnumerateUtilsTests.cs" company="RzR SOFT & TECH">
// Copyright © RzR. All rights reserved.
// </copyright>
//
// <summary>
// </summary>
// ***********************************************************************

using System.Linq;
using DomainCommonExtensions.Utilities;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DataTypeTests
{
[TestClass]
public class EnumerateUtilsTests
{
[TestMethod]
public void Int32_FromTo_0_2_Test()
{
var list = EnumerateUtils.FromTo(0, 2);

Assert.IsNotNull(list);
Assert.IsTrue(list.Count() == 3);
}

[TestMethod]
public void Int32_FromTo_0_0_Test()
{
var list = EnumerateUtils.FromTo(0, 0);

Assert.IsNotNull(list);
Assert.IsTrue(list.Count() == 1);
}

[TestMethod]
public void Int32_FromTo_Minus5_0_Test()
{
var list = EnumerateUtils.FromTo(-5, 0);

Assert.IsNotNull(list);
Assert.IsTrue(list.Count() == 6);
}

[TestMethod]
public void Int32_FromTo_4_3_Test()
{
var list = EnumerateUtils.FromTo(4, 3);

Assert.IsNotNull(list);
Assert.IsFalse(list.Any());
}

[TestMethod]
public void PowersOf_Test()
{
var list = EnumerateUtils.PowersOf(2, 4);

Assert.IsNotNull(list);
Assert.IsTrue(list.Any());
}
}
}

0 comments on commit 5463c06

Please sign in to comment.