예제 #1
0
        public void ShouldGenerateDifferentHashcode()
        {
            var dateTime1 = new CypherDateTime(1947, 12, 17, 15, 12, 01, 789000000);
            var dateTime2 = new CypherDateTime(new DateTime(1947, 12, 17, 15, 12, 01, 790));
            var dateTime3 = new CypherDateTime(-695551678, 788000000);

            dateTime1.GetHashCode().Should().NotBe(dateTime2.GetHashCode()).And.NotBe(dateTime3.GetHashCode());
        }
예제 #2
0
        public void ShouldGenerateSameHashcode()
        {
            var dateTime1 = new CypherDateTime(1947, 12, 17, 15, 12, 01, 789000000);
            var dateTime2 = new CypherDateTime(new DateTime(1947, 12, 17, 15, 12, 01, 789, DateTimeKind.Local));
            var dateTime3 = new CypherDateTime(-695551679, 789000000);

            dateTime1.GetHashCode().Should().Be(dateTime2.GetHashCode()).And.Be(dateTime3.GetHashCode());
        }