public void ShouldBeEqual()
        {
            var duration1 = new CypherDuration(15, 32, 785, 789215800);
            var duration2 = new CypherDuration(15, 32, 785, 789215800);

            duration1.Equals(duration2).Should().BeTrue();
        }
        public void ShouldGenerateCorrectString()
        {
            var cypherDuration    = new CypherDuration(15, 32, 785, 789215800);
            var cypherDurationStr = cypherDuration.ToString();

            cypherDurationStr.Should().Be($"Duration{{months: 15, days: 32, seconds: 785, nanos: 789215800}}");
        }
        public void ShouldGenerateDifferentHashcode()
        {
            var duration1 = new CypherDuration(15, 32, 785, 789215800);
            var duration2 = new CypherDuration(15, 32, 785, 789215801);

            duration1.GetHashCode().Should().NotBe(duration2.GetHashCode());
        }
        public void ShouldNotBeEqualToNull()
        {
            var duration = new CypherDuration(15, 32, 785, 789215800);
            var other    = (object)null;

            duration.Equals(other).Should().BeFalse();
        }
        public void ShouldNotBeEqualToAnotherType()
        {
            var duration = new CypherDuration(15, 32, 785, 789215800);
            var other    = "some string";

            duration.Equals(other).Should().BeFalse();
        }
        public void ShouldCreateDurationWithDaysSecondsAndNanoseconds()
        {
            var cypherDuration = new CypherDuration(45, 785, 789215800);

            cypherDuration.Months.Should().Be(0);
            cypherDuration.Days.Should().Be(45);
            cypherDuration.Seconds.Should().Be(785);
            cypherDuration.Nanos.Should().Be(789215800);
        }
        public void ShouldCreateDurationWithSecondsOnly()
        {
            var cypherDuration = new CypherDuration(785);

            cypherDuration.Months.Should().Be(0);
            cypherDuration.Days.Should().Be(0);
            cypherDuration.Seconds.Should().Be(785);
            cypherDuration.Nanos.Should().Be(0);
        }
        public void ShouldCreateDuration()
        {
            var cypherDuration = new CypherDuration(15, 32, 785, 789215800);

            cypherDuration.Months.Should().Be(15);
            cypherDuration.Days.Should().Be(32);
            cypherDuration.Seconds.Should().Be(785);
            cypherDuration.Nanos.Should().Be(789215800);
        }
Exemplo n.º 9
0
        public void ShouldSendAndReceiveDuration()
        {
            var data = new CypherDuration(14, 35, 75, 789012587);

            TestSendAndReceiveData(
                "CYPHER runtime=interpreted WITH $x AS x RETURN x, x.months, x.days, x.seconds, x.millisecondsOfSecond, x.microsecondsOfSecond, x.nanosecondsOfSecond",
                data,
                new object[]
            {
                data,
                14L,
                35L,
                75L,
                789L,
                789012L,
                789012587L
            });
        }