Example #1
0
        public void EqualsReturnsTrueIfSameObject()
        {
            var fileLock = new FileLock(123, "ProcessName", 456, DateTime.Now.Ticks);

            // ReSharper disable once EqualExpressionComparison
            Assert.That(fileLock.Equals(fileLock), Is.True);
        }
Example #2
0
        public void EqualsReturnsFalseIfOtherObjectIsDifferentType()
        {
            var fileLock = new FileLock {
                ProcessId = 123, ProcessName = "ProcessName", ThreadId = 456, Timestamp = DateTime.Now.Ticks
            };

            Assert.That(fileLock.Equals(new object()), Is.False);
        }
Example #3
0
        public void EqualsReturnsTrueIfSameObject()
        {
            var fileLock = new FileLock {
                ProcessId = 123, ProcessName = "ProcessName", ThreadId = 456, Timestamp = DateTime.Now.Ticks
            };

            // ReSharper disable once EqualExpressionComparison
            Assert.That(fileLock.Equals(fileLock), Is.True);
        }
Example #4
0
        public void EqualsReturnsFalseIfOtherObjectIsDifferentType()
        {
            var fileLock = new FileLock(123, "ProcessName", 456, DateTime.Now.Ticks);

            Assert.That(fileLock.Equals(new object()), Is.False);
        }
Example #5
0
        public void EqualsReturnsFalseIfOtherObjectIsNull()
        {
            var fileLock = new FileLock(123, "ProcessName", 456, DateTime.Now.Ticks);

            Assert.That(fileLock.Equals(null), Is.False);
        }