Пример #1
0
        public void ClientIdentifier_AreNotEqualWhenNameServerPortAreNotEqualWithNoGuid()
        {
            // Arrange
            var x = new ClientIdentifier("Foo", "Bar", ClientSettings.DefaultPort, Guid.Empty);
            var y = new ClientIdentifier("Fizz", "Bizz", 46330, Guid.Empty);
            // Act
            var result = x.Equals(y) | x.GetHashCode() == y.GetHashCode();

            // Assert
            Assert.IsFalse(result);
        }
Пример #2
0
        public void ClientIdentifier_AreNotEqualWhenGuidsAreNotEqual()
        {
            // Arrange
            var x = new ClientIdentifier("Foo", "Bar", ClientSettings.DefaultPort, Guid.NewGuid());
            var y = new ClientIdentifier("Foo", "Bar", ClientSettings.DefaultPort, Guid.NewGuid());
            // Act
            var result = x.Equals(y) | x.GetHashCode() == y.GetHashCode();

            // Assert
            Assert.IsFalse(result);
        }
Пример #3
0
        public void ClientIdentifier_AreNotEqualWhenSecondHasGuid()
        {
            // Arrange
            var x = new ClientIdentifier(null, null, ClientSettings.NoPort, Guid.Empty);
            var y = new ClientIdentifier(null, null, ClientSettings.NoPort, Guid.NewGuid());
            // Act
            var result = x.Equals(y) | x.GetHashCode() == y.GetHashCode();

            // Assert
            Assert.IsFalse(result);
        }
Пример #4
0
        public void ClientIdentifier_AreEqualWhenGuidsAreEqual()
        {
            // Arrange
            var guid = Guid.NewGuid();
            var x    = new ClientIdentifier("Foo", "Bar", ClientSettings.DefaultPort, guid);
            var y    = new ClientIdentifier("Fizz", "Bizz", 46330, guid);
            // Act
            var result = x.Equals(y) & x.GetHashCode() == y.GetHashCode();

            // Assert
            Assert.IsTrue(result);
        }
Пример #5
0
 public bool Equals(SlotIdentifier other)
 {
     return(Ordinal == other.Ordinal && ClientIdentifier.Equals(other.ClientIdentifier) && SlotID == other.SlotID);
 }