public void ImplicitConversionFromNullString()
        {
            string nullString = null;

            Nest.AutoExpandReplicas autoExpandReplicas = nullString;
            autoExpandReplicas.Should().BeNull();
        }
Exemplo n.º 2
0
        public void ImplicitConversionFromMinAndMaxString()
        {
            string minAndMax = "0-5";

            Nest.AutoExpandReplicas autoExpandReplicas = minAndMax;
            autoExpandReplicas.Should().NotBeNull();
            autoExpandReplicas.Enabled.Should().BeTrue();
            autoExpandReplicas.MinReplicas.Should().Be(0);
            autoExpandReplicas.MaxReplicas.Match(i => i.Should().Be(5), s => Assert.True(false, "expecting a match on integer"));

            autoExpandReplicas.ToString().Should().Be(minAndMax);
        }
        public void ImplicitConversionFromMinAndAllString()
        {
            var minAndMax = "0-all";

            Nest.AutoExpandReplicas autoExpandReplicas = minAndMax;
            autoExpandReplicas.Should().NotBeNull();
            autoExpandReplicas.Enabled.Should().BeTrue();
            autoExpandReplicas.MinReplicas.Should().Be(0);
            autoExpandReplicas.MaxReplicas.Match(
                i => Assert.True(false, "expecting a match on string"),
                s => s.Should().Be("all"));

            autoExpandReplicas.ToString().Should().Be(minAndMax);
        }