public void ShouldBeEqual() { var time1 = new CypherTimeWithOffset(12, 49, 55, 123000000, 1500); var time2 = new CypherTimeWithOffset(new DateTime(2017, 1, 1, 12, 49, 55, 123), TimeSpan.FromSeconds(1500)); var time3 = new CypherTimeWithOffset(new TimeSpan(0, 12, 49, 55, 123), TimeSpan.FromSeconds(1500)); var time4 = new CypherTimeWithOffset(46195123000000, 1500); time1.Equals(time2).Should().BeTrue(); time1.Equals(time3).Should().BeTrue(); time1.Equals(time4).Should().BeTrue(); }
public void ShouldNotBeEqualToNull() { var time = new CypherTimeWithOffset(12, 49, 55, 123000000, 1800); var other = (object)null; time.Equals(other).Should().BeFalse(); }
public void ShouldNotBeEqualToAnotherType() { var time = new CypherTimeWithOffset(12, 49, 55, 123000000, 1800); var other = "some string"; time.Equals(other).Should().BeFalse(); }