public void GetHashCodeTest() { Assert.AreEqual(0, new TimerProcessorItem().GetHashCode()); Assert.AreEqual(new TimerProcessorItem().GetHashCode(), new TimerProcessorItem().GetHashCode()); Assert.AreNotEqual(TimerProcessorItem.Add <object>(DateTime.Now, TimeSpan.FromSeconds(1)), TimerProcessorItem.Add <object>(DateTime.Now, TimeSpan.FromSeconds(1))); }
public void Initialized() { var aa = TimerProcessorItem.Add <object>(DateTime.Now, TimeSpan.Zero); var bb = TimerProcessorItem.Add <object>(DateTime.Now, TimeSpan.Zero); Assert.IsTrue(aa != bb); }
public void TryCancel() { var item = TimerProcessorItem.Add <object>(DateTime.Now, TimeSpan.FromSeconds(1)); item.TryCancel(); Assert.IsNotNull(item.Expired); Assert.IsTrue(item.Expired.Value); }
public void TrySetException2() { var item = TimerProcessorItem.Add <object>(DateTime.Now, TimeSpan.FromSeconds(1)); item.TrySetException(new Exception("ex")); Assert.IsNotNull(item.Expired); Assert.IsTrue(item.Expired.Value); }
public void Equals() { object aa = TimerProcessorItem.Add <object>(DateTime.Now, TimeSpan.Zero); // ReSharper disable EqualExpressionComparison Assert.IsTrue(aa.Equals(aa)); // ReSharper restore EqualExpressionComparison }