本文整理汇总了C#中BsonArray.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# BsonArray.Equals方法的具体用法?C# BsonArray.Equals怎么用?C# BsonArray.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BsonArray
的用法示例。
在下文中一共展示了BsonArray.Equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestBsonArrayEquals
public void TestBsonArrayEquals()
{
var a = new BsonArray { "a", 1 };
var b = new BsonArray { "a", 1 };
var c = new BsonArray { "b", 1 };
var n = (BsonArray)null;
Assert.IsTrue(object.Equals(a, b));
Assert.IsFalse(object.Equals(a, c));
Assert.IsFalse(a.Equals(n));
Assert.IsFalse(a.Equals(null));
Assert.IsTrue(a == b);
Assert.IsFalse(a == c);
Assert.IsFalse(a == null);
Assert.IsFalse(null == a);
Assert.IsTrue(n == null);
Assert.IsTrue(null == n);
Assert.IsFalse(a != b);
Assert.IsTrue(a != c);
Assert.IsTrue(a != null);
Assert.IsTrue(null != a);
Assert.IsFalse(n != null);
Assert.IsFalse(null != n);
}
示例2: AutoVivifyCanExtendLeafByOneArray
public void AutoVivifyCanExtendLeafByOneArray()
{
var bson = new BsonArray {new BsonArray {"test", new BsonArray {"doc"}}, "foo"};
bson.AvArray("[0][1][1]").Add("baz");
var expected = new BsonArray {new BsonArray {"test", new BsonArray {"doc", new BsonArray {"baz"}}}, "foo"};
Assert.That(bson.Equals(expected));
}
示例3: AutoVivifyCanAddressContainedPathsArray
public void AutoVivifyCanAddressContainedPathsArray()
{
var bson = new BsonArray {new BsonArray {"test", new BsonArray {"doc"}}, "foo"};
bson.AvArray("[0]").Add("baz");
var expected = new BsonArray {new BsonArray {"test", new BsonArray {"doc"}, "baz"}, "foo"};
Assert.That(bson.Equals(expected));
}
示例4: TestEquals
public void TestEquals()
{
var a = new BsonArray { 1, 2 };
var b = new BsonArray { 1, 2 };
var c = new BsonArray { 3, 4 };
Assert.IsTrue(a.Equals((object)a));
Assert.IsTrue(a.Equals((object)b));
Assert.IsFalse(a.Equals((object)c));
Assert.IsFalse(a.Equals((object)null));
Assert.IsFalse(a.Equals((object)1)); // types don't match
}