コード例 #1
0
 [U] public void NotEq()
 {
     Nest.Indices   types    = "foo,bar";
     Nest.Indices[] notEqual = { "foo,bar,x", "foo", typeof(Project) };
     foreach (var t in notEqual)
     {
         (t != types).ShouldBeTrue(t);
         t.Should().NotBe(types);
     }
 }
コード例 #2
0
        /** # Indices paths
         *
         * Some API's in elasticsearch take one or many index name or a special "_all" marker to send the request to all the indices
         * In nest this is encoded using `Indices`
         */

        /** Several types implicitly convert to `Indices` */
        [U] public void ImplicitConversionFromString()
        {
            Nest.Indices singleIndexFromString     = "name";
            Nest.Indices multipleIndicesFromString = "name1, name2";
            Nest.Indices allFromString             = "_all";
            Nest.Indices allWithOthersFromString   = "_all, name2";

            singleIndexFromString.Match(
                all => all.Should().BeNull(),
                many => many.Indices.Should().HaveCount(1).And.Contain("name")
                );
        }
コード例 #3
0
        [U] public void Eq()
        {
            Nest.Indices   types = "foo,bar";
            Nest.Indices[] equal = { "foo,bar", "bar,foo", "foo,  bar", "bar,  foo   " };
            foreach (var t in equal)
            {
                (t == types).ShouldBeTrue(t);
                t.Should().Be(types);
            }

            (Nest.Indices.All == "_all").Should().BeTrue();
        }
コード例 #4
0
 [U] public void Null()
 {
     Nest.Indices value = typeof(Project);
     (value == null).Should().BeFalse();
     (null == value).Should().BeFalse();
 }
コード例 #5
0
 [U] public void TypedNotEq()
 {
     Nest.Indices t1 = typeof(Project), t2 = typeof(CommitActivity);
     (t1 != t2).ShouldBeTrue(t2);
 }
コード例 #6
0
 [U] public void TypedEq()
 {
     Nest.Indices t1 = typeof(Project), t2 = typeof(Project);
     (t1 == t2).ShouldBeTrue(t2);
 }