-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
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
36 changes: 36 additions & 0 deletions
36
Objectivity.Test.Automation.UnitTests/Tests/DateHelperTests.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,36 @@ | ||
using System; | ||
using System.Globalization; | ||
using NUnit.Framework; | ||
using Objectivity.Test.Automation.Common.Helpers; | ||
|
||
namespace Objectivity.Test.Automation.UnitTests.Tests | ||
{ | ||
[TestFixture()] | ||
[TestFixture, Parallelizable(ParallelScope.Self)] | ||
public class DateHelperTests | ||
{ | ||
[Test()] | ||
public void TomorrowDateTest() | ||
{ | ||
Assert.AreEqual(DateTime.Now.AddDays(1).ToString("ddMMyyyy", CultureInfo.CurrentCulture), DateHelper.TomorrowDate); | ||
} | ||
|
||
[Test()] | ||
public void CurrentDateTest() | ||
{ | ||
Assert.AreEqual(DateTime.Now.ToString("dd-MM-yyyy", CultureInfo.CurrentCulture), DateHelper.CurrentDate); | ||
} | ||
|
||
[Test()] | ||
public void CurrentTimeStampTest() | ||
{ | ||
Assert.AreEqual(DateTime.Now.ToString("ddMMyyyyHHmmss", CultureInfo.CurrentCulture), DateHelper.CurrentTimeStamp); | ||
} | ||
|
||
[Test()] | ||
public void GetFutureDateTest() | ||
{ | ||
Assert.AreEqual(DateTime.Now.AddDays(3).ToString("ddMMyyyy", CultureInfo.CurrentCulture), DateHelper.GetFutureDate(3)); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
Objectivity.Test.Automation.UnitTests/Tests/NameHelperTests.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,21 @@ | ||
using NUnit.Framework; | ||
using Objectivity.Test.Automation.Common.Helpers; | ||
|
||
namespace Objectivity.Test.Automation.UnitTests.Tests | ||
{ | ||
[TestFixture()] | ||
[TestFixture, Parallelizable(ParallelScope.Self)] | ||
public class NameHelperTests | ||
{ | ||
[Test()] | ||
public void ShortenFileNameTest() | ||
{ | ||
var name = "verylongfilename 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0.txt"; | ||
var text = NameHelper.ShortenFileName(TestContext.CurrentContext.TestDirectory, name, "_", 255); | ||
Assert.IsTrue((TestContext.CurrentContext.TestDirectory + name).Length > 255); | ||
text = NameHelper.ShortenFileName(TestContext.CurrentContext.TestDirectory, name, " ", 255); | ||
Assert.AreEqual(255, (TestContext.CurrentContext.TestDirectory + text).Length); | ||
} | ||
|
||
} | ||
} |