public void WithAddressFamily_returns_same_instance_if_value_is_equal() { var subject1 = new TcpStreamSettings(); var subject2 = subject1.WithAddressFamily(AddressFamily.InterNetwork); subject2.Should().BeSameAs(subject1); }
public void WithAddressFamily_returns_new_instance_if_value_is_not_equal() { var oldSetting = AddressFamily.InterNetwork; var newSetting = AddressFamily.InterNetworkV6; var subject1 = new TcpStreamSettings().WithAddressFamily(oldSetting); var subject2 = subject1.WithAddressFamily(newSetting); subject2.Should().NotBeSameAs(subject1); subject1.AddressFamily.Should().Be(oldSetting); subject2.AddressFamily.Should().Be(newSetting); }