public void SlotIdentifier_AreNotEqualWhenNameServerPortAreNotEqualWithNoGuid() { // Arrange var x = new SlotIdentifier(new ClientIdentifier("Foo", "Bar", ClientSettings.DefaultPort, Guid.Empty), SlotIdentifier.NoSlotID); var y = new SlotIdentifier(new ClientIdentifier("Fizz", "Bizz", 46330, Guid.Empty), SlotIdentifier.NoSlotID); // Act var result = x.Equals(y) | x.GetHashCode() == y.GetHashCode(); // Assert Assert.IsFalse(result); }
public void SlotIdentifier_AreNotEqualWhenGuidsAreNotEqual() { // Arrange var x = new SlotIdentifier(new ClientIdentifier("Foo", "Bar", ClientSettings.DefaultPort, Guid.NewGuid()), SlotIdentifier.NoSlotID); var y = new SlotIdentifier(new ClientIdentifier("Foo", "Bar", ClientSettings.DefaultPort, Guid.NewGuid()), SlotIdentifier.NoSlotID); // Act var result = x.Equals(y) | x.GetHashCode() == y.GetHashCode(); // Assert Assert.IsFalse(result); }
public void SlotIdentifier_AreNotEqualWhenSecondHasGuid() { // Arrange var x = new SlotIdentifier(new ClientIdentifier(null, null, ClientSettings.NoPort, Guid.Empty), SlotIdentifier.NoSlotID); var y = new SlotIdentifier(new ClientIdentifier(null, null, ClientSettings.NoPort, Guid.NewGuid()), SlotIdentifier.NoSlotID); // Act var result = x.Equals(y) | x.GetHashCode() == y.GetHashCode(); // Assert Assert.IsFalse(result); }
public void SlotIdentifier_AreEqualWhenGuidsAreEqual() { // Arrange var guid = Guid.NewGuid(); var x = new SlotIdentifier(new ClientIdentifier("Foo", "Bar", ClientSettings.DefaultPort, guid), SlotIdentifier.NoSlotID); var y = new SlotIdentifier(new ClientIdentifier("Fizz", "Bizz", 46330, guid), SlotIdentifier.NoSlotID); // Act var result = x.Equals(y) & x.GetHashCode() == y.GetHashCode(); // Assert Assert.IsTrue(result); }