using System;
using FluentAssertions;
using NUnit.Framework;
using Withings.NET.Client;

namespace Withings.Specifications
{
    [TestFixture]
    public class DateTimeExtensionsTests
    {
        [Test]
        public void DoubleFromUnixTimeTest()
        {
            ((double)1491934309).FromUnixTime().Date.Should().Equals(DateTime.Parse("04/11/2017"));
        }

        [Test]
        public void LongFromUnixTimeTest()
        {
            ((long)1491934309).FromUnixTime().Date.Should().Equals(DateTime.Parse("04/11/2017"));
        }

        [Test]
        public void IntFromUnixTimeTest()
        {
            1491934309.FromUnixTime().Date.Should().Equals(DateTime.Parse("04/11/2017"));
        }

        [Test]
        public void DateTimeToUnixTimeTest()
        {
            DateTime.Parse("04/11/2017").Should().Equals(1491934309);
        }
    }
}
using System;
using FluentAssertions;
using NUnit.Framework;
using Withings.NET.Client;

namespace Withings.Specifications
{
    [TestFixture]
    public class DateTimeExtensionsTests
    {
        [Test]
        public void DoubleFromUnixTimeTest()
        {
            ((double)1491934309).FromUnixTime().Date.Should().Equals(DateTime.Parse("04/11/2017"));
        }

        [Test]
        public void LongFromUnixTimeTest()
        {
            ((long)1491934309).FromUnixTime().Date.Should().Equals(DateTime.Parse("04/11/2017"));
        }

        [Test]
        public void IntFromUnixTimeTest()
        {
            1491934309.FromUnixTime().Date.Should().Equals(DateTime.Parse("04/11/2017"));
        }

        [Test]
        public void DateTimeToUnixTimeTest()
        {
            DateTime.Parse("04/11/2017").ToUnixTime().Should().Equals(1491934309);
        }
    }
}
Add Tests For DateTime Extensions
Add Tests For DateTime Extensions
