<commit_before>﻿// // --------------------------------------------------------------------------------------------------------------------
// // <copyright file="DateTimeRelatedTests.cs" company="">
// //   Copyright 2013 <NAME>
// //   Licensed under the Apache License, Version 2.0 (the "License");
// //   you may not use this file except in compliance with the License.
// //   You may obtain a copy of the License at
// //       http://www.apache.org/licenses/LICENSE-2.0
// //   Unless required by applicable law or agreed to in writing, software
// //   distributed under the License is distributed on an "AS IS" BASIS,
// //   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// //   See the License for the specific language governing permissions and
// //   limitations under the License.
// // </copyright>
// // --------------------------------------------------------------------------------------------------------------------
namespace NFluent.Tests
{
    using System;

    using NUnit.Framework;

    [TestFixture]
    public class DateTimeRelatedTests
    {
         [Test]
         public void IsBeforeWorks()
         {
             var christmas2013 = new DateTime(2013, 12, 25);
             var newYearsEve2014 = new DateTime(2013, 12, 31);

             Check.That(christmas2013).IsBefore(newYearsEve2014);
             Check.That(christmas2013).IsBeforeOrEqualTo(newYearsEve2014);
             Check.That(christmas2013).IsBeforeOrEqualTo(christmas2013);
             Check.That(christmas2013).IsBeforeOrEqualTo(new DateTime(2013, 12, 25));
         }

         [Test]
         [ExpectedException(ExpectedException = typeof(FluentAssertionException), ExpectedMessage = "The actual date time [2013-12-31T00:00:00.0000000, Kind = Unspecified] is not before the given one [2013-12-25T00:00:00.0000000, Kind = Unspecified]")]
         public void IsBeforeThrowsExceptionWhenNotBefore()
         {
             var christmas2013 = new DateTime(2013, 12, 25);
             var newYearsEve2014 = new DateTime(2013, 12, 31);
             
             Check.That(newYearsEve2014).IsBefore(christmas2013);
         }

         [Test]
         [ExpectedException(ExpectedException = typeof(FluentAssertionException), ExpectedMessage = "The actual date time [2013-12-31T00:00:00.0000000, Kind = Unspecified] is not before or equals to the given one [2013-12-25T00:00:00.0000000, Kind = Unspecified]")]
         public void IsBeforeOrEqualThrowsExceptionWhenNotBeforeOrEqual()
         {
             var christmas2013 = new DateTime(2013, 12, 25);
             var newYearsEve2014 = new DateTime(2013, 12, 31);

             Check.That(newYearsEve2014).IsBeforeOrEqualTo(christmas2013);
         }

         [Test]
         public void IsAfterWorks()
         {
             var christmas2013 = new DateTime(2013, 12, 25);
             var newYearsEve2014 = new DateTime(2013, 12, 31);

             Check.That(newYearsEve2014).IsAfter(christmas2013);
             Check.That(newYearsEve2014).IsAfterOrEqualTo(new DateTime(2013, 12, 31));
         }

         [Test]
         [ExpectedException(ExpectedException = typeof(FluentAssertionException), ExpectedMessage = "The actual date time [2013-12-25T00:00:00.0000000, Kind = Unspecified] is not after the given one [2013-12-31T00:00:00.0000000, Kind = Unspecified]")]
         public void IsAfterThrowsExceptionWhenNotAfter()
         {
             var christmas2013 = new DateTime(2013, 12, 25);
             var newYearsEve2014 = new DateTime(2013, 12, 31);

             Check.That(christmas2013).IsAfter(newYearsEve2014);
         }

         [Test]
         [ExpectedException(ExpectedException = typeof(FluentAssertionException), ExpectedMessage = "The actual date time [2013-12-25T00:00:00.0000000, Kind = Unspecified] is not after or equals to the given one [2013-12-31T00:00:00.0000000, Kind = Unspecified]")]
         public void IsAfterOrEqualThrowsExceptionWhenNotAfterOrEqual()
         {
             var christmas2013 = new DateTime(2013, 12, 25);
             var newYearsEve2014 = new DateTime(2013, 12, 31);

             Check.That(christmas2013).IsAfterOrEqualTo(newYearsEve2014);
         }

         [Test]
         [ExpectedException(ExpectedException = typeof(FluentAssertionException), ExpectedMessage = "[2013-12-24T23:00:00.0000000Z, Kind = Utc] not equals to the expected [2013-12-30T23:00:00.0000000Z, Kind = Utc]")]
         public void IsEqualToThrowsExceptionWhenNotEqual()
         {
             var christmasUtc2013 = new DateTime(2013, 12, 25).ToUniversalTime();
             var newYearsEveUtc2014 = new DateTime(2013, 12, 31).ToUniversalTime();

             Check.That(christmasUtc2013).IsEqualTo(newYearsEveUtc2014);
         }

         [Test]
         [ExpectedException(ExpectedException = typeof(FluentAssertionException), ExpectedMessage = "[2013-12-24T23:00:00.0000000Z, Kind = Utc] not equals to the expected [\"Batman\"]")]
         public void IsEqualToThrowsExceptionWhenTypeDiffer()
         {
             var christmasUtc2013 = new DateTime(2013, 12, 25).ToUniversalTime();

             Check.That(christmasUtc2013).IsEqualTo("Batman");
         }

         [Test]
         [ExpectedException(ExpectedException = typeof(FluentAssertionException), ExpectedMessage = "[2013-12-25T00:00:00.0000000, Kind = Unspecified] equals to the value [2013-12-25T00:00:00.0000000, Kind = Unspecified] which is not expected.")]
         public void IsNotEqualToThrowsExceptionWhenEqual()
         {<commit_msg>Fix failing test related to Montreal Time Zone<commit_after>﻿// // --------------------------------------------------------------------------------------------------------------------
// // <copyright file="DateTimeRelatedTests.cs" company="">
// //   Copyright 2013 <NAME>
// //   Licensed under the Apache License, Version 2.0 (the "License");
// //   you may not use this file except in compliance with the License.
// //   You may obtain a copy of the License at
// //       http://www.apache.org/licenses/LICENSE-2.0
// //   Unless required by applicable law or agreed to in writing, software
// //   distributed under the License is distributed on an "AS IS" BASIS,
// //   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// //   See the License for the specific language governing permissions and
// //   limitations under the License.
// // </copyright>
// // --------------------------------------------------------------------------------------------------------------------
namespace NFluent.Tests
{
    using System;

    using NUnit.Framework;

    [TestFixture]
    public class DateTimeRelatedTests
    {
         [Test]
         public void IsBeforeWorks()
         {
             var christmas2013 = new DateTime(2013, 12, 25);
             var newYearsEve2014 = new DateTime(2013, 12, 31);

             Check.That(christmas2013).IsBefore(newYearsEve2014);
             Check.That(christmas2013).IsBeforeOrEqualTo(newYearsEve2014);
             Check.That(christmas2013).IsBeforeOrEqualTo(christmas2013);
             Check.That(christmas2013).IsBeforeOrEqualTo(new DateTime(2013, 12, 25));
         }

         [Test]
         [ExpectedException(ExpectedException = typeof(FluentAssertionException), ExpectedMessage = "The actual date time [2013-12-31T00:00:00.0000000, Kind = Unspecified] is not before the given one [2013-12-25T00:00:00.0000000, Kind = Unspecified]")]
         public void IsBeforeThrowsExceptionWhenNotBefore()
         {
             var christmas2013 = new DateTime(2013, 12, 25);
             var newYearsEve2014 = new DateTime(2013, 12, 31);
             
             Check.That(newYearsEve2014).IsBefore(christmas2013);
         }

         [Test]
         [ExpectedException(ExpectedException = typeof(FluentAssertionException), ExpectedMessage = "The actual date time [2013-12-31T00:00:00.0000000, Kind = Unspecified] is not before or equals to the given one [2013-12-25T00:00:00.0000000, Kind = Unspecified]")]
         public void IsBeforeOrEqualThrowsExceptionWhenNotBeforeOrEqual()
         {
             var christmas2013 = new DateTime(2013, 12, 25);
             var newYearsEve2014 = new DateTime(2013, 12, 31);

             Check.That(newYearsEve2014).IsBeforeOrEqualTo(christmas2013);
         }

         [Test]
         public void IsAfterWorks()
         {
             var christmas2013 = new DateTime(2013, 12, 25);
             var newYearsEve2014 = new DateTime(2013, 12, 31);

             Check.That(newYearsEve2014).IsAfter(christmas2013);
             Check.That(newYearsEve2014).IsAfterOrEqualTo(new DateTime(2013, 12, 31));
         }

         [Test]
         [ExpectedException(ExpectedException = typeof(FluentAssertionException), ExpectedMessage = "The actual date time [2013-12-25T00:00:00.0000000, Kind = Unspecified] is not after the given one [2013-12-31T00:00:00.0000000, Kind = Unspecified]")]
         public void IsAfterThrowsExceptionWhenNotAfter()
         {
             var christmas2013 = new DateTime(2013, 12, 25);
             var newYearsEve2014 = new DateTime(2013, 12, 31);

             Check.That(christmas2013).IsAfter(newYearsEve2014);
         }

         [Test]
         [ExpectedException(ExpectedException = typeof(FluentAssertionException), ExpectedMessage = "The actual date time [2013-12-25T00:00:00.0000000, Kind = Unspecified] is not after or equals to the given one [2013-12-31T00:00:00.0000000, Kind = Unspecified]")]
         public void IsAfterOrEqualThrowsExceptionWhenNotAfterOrEqual()
         {
             var christmas2013 = new DateTime(2013, 12, 25);
             var newYearsEve2014 = new DateTime(2013, 12, 31);

             Check.That(christmas2013).IsAfterOrEqualTo(newYearsEve2014);
         }

         [Test]
         public void IsEqualToWorksWhenMixingDateKind()
         {
             var christmasUtc2013 = new DateTime(2013, 12, 25, 0, 0, 0, DateTimeKind.Utc);
             var christmas2013WithUnspecifiedDateKindExplicit = new DateTime(2013, 12, 25, 0, 0, 0, DateTimeKind.Unspecified);
             var christmas2013WithUnspecifiedDateKindImplicit = new DateTime(2013, 12, 25);
             var christmasInLocalTime2013 = new DateTime(2013, 12, 25, 0, 0, 0, DateTimeKind.Local);

             Check.That(christmasUtc2013)
                 .IsEqualTo(christmas2013WithUnspecifiedDateKindExplicit).And
                 .IsEqualTo(christmas2013WithUnspecifiedDateKindImplicit).And
                 .IsEqualTo(christmasInLocalTime2013);
         }
         
         [Test]
         [ExpectedException(ExpectedException = typeof(FluentAssertionException), ExpectedMessage = "[2013-12-25T00:00:00.0000000, Kind = Unspecified] not equals to the expected [2013-12-31T00:00:00.0000000, Kind = Unspecified]")]
         public void IsEqualToThrowsExceptionWhenNotEqual()
         {
             var christmas2013 = new DateTime(2013, 12, 25);
             var newYearsEve2014 = new DateTime(2013, 12, 31);

             Check.That(christmas2013).IsEqualTo(newYearsEve2014);
         }

         [Test]
         [ExpectedException(ExpectedException = typeof(FluentAssertionException), ExpectedMessage = "[2013-12-25T00:00:00.0000000, Kind = Unspecified] not equals to the expected [\"Batman\"]")]
         public void IsEqualToThrowsExceptionWhenTypeDiffer()
         {
             var christmas2013 = new DateTime(2013, 12, 25);

             Check.That(christmas2013).IsEqualTo("Batman");
         }

         [Test]
         [ExpectedException(ExpectedException = typeof(FluentAssertionException), ExpectedMessage = "[2013-12-25T00:00:00.0000000, Kind = Unspecified] equals to the value [2013-12-25T00:00:00.0000000, Kind = Unspecified] which is not expected.")]
         public void IsNotEqualToThrowsExceptionWhenEqual()
         {
{'fraction_non_alphanumeric': 0.13708245243128964, 'fraction_numerical': 0.1010570824524313, 'mean_word_length': 2.3895098882201204, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 26, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4922310', 'n_tokens_mistral': 4124, 'n_tokens_neox': 3162, 'n_words': 781}