Beispiel #1
0
        public void TestEquals()
        {
            var a = new MongoGridFSSettings()
            {
                ChunkSize = 123
            };
            var b = new MongoGridFSSettings()
            {
                ChunkSize = 123
            };
            var c = new MongoGridFSSettings()
            {
                ChunkSize = 345
            };
            var n = (WriteConcern)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);
        }
Beispiel #2
0
        public void TestEquals()
        {
            var a = new MongoGridFSSettings(123, "root", SafeMode.True);
            var b = new MongoGridFSSettings(123, "root", SafeMode.True);;
            var c = new MongoGridFSSettings(345, "root", SafeMode.True);
            var n = (SafeMode)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);
        }