Specifying a tolerance with "Within" doesn't work for DateTimeOffset data types

Bug #1089345 reported by Peter Strøiman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit Framework
Triaged
Medium
Unassigned

Bug Description

[Issue now tracked at https://github.com/nunit/nunit-framework/issues/29]

I would expect the following test to pass:

        [Test]
        public void DtoTest()
        {
            var a = DateTimeOffset.Parse("2012-01-01T12:00Z");
            var b = DateTimeOffset.Parse("2012-01-01T12:01Z");
            Assert.That(a, Is.EqualTo(b).Within(TimeSpan.FromMinutes(2)));
        }

NUnit.framework version 2.6.2.12296

Tags: github
Revision history for this message
Charlie Poole (charlie.poole) wrote :

NUnit currently has special code for comparing two DateTimes within a tolerance, but not for DateTimeOffset.

Changed in nunitv2:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 2.6.3
Changed in nunitv2:
milestone: 2.6.3 → none
affects: nunitv2 → nunit-3.0
description: updated
tags: added: github
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.