Skip to content

Conversation

@nazariyskoropad
Copy link

using NUnit.Framework;
using System;

namespace TestProject1.TimeZoneConverter
{
[TestFixture]
public class TimeZoneConverterTest
{
[Test]
public void CheckConvertToEst()
{
//arrange
var currentTime = DateTime.Now;
TimeZoneInfo easternZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
var expectedResult = TimeZoneInfo.ConvertTime(currentTime, TimeZoneInfo.Local, easternZone);

        //act
        var actualResult = TimeZoneConverter.ConvertToEst(currentTime);

        //assert
        Assert.AreEqual(expectedResult, actualResult);
    }

    [Test]
    public void CheckConvertToUts()
    {           
        //arrange
        var currentTime = DateTime.Now;
        var expectedResult = TimeZoneInfo.ConvertTimeToUtc(currentTime);

        //act
        var actualResult = TimeZoneConverter.ConvertToUtc(currentTime);

        //assert
        Assert.AreEqual(expectedResult, actualResult);
    }
}

}

Copy link
Owner

@aceofbase199 aceofbase199 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only one file should be added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants