public void GivenNonNullValue_Clones_AndSetsMemberToSpecifiedValue() { var bar = new CloneableBar(); var actual = bar.CloneWith(_ => _.Value, "ABC"); actual.Value.Should().Be("ABC"); actual.Should().NotBeSameAs(bar); }
public void GivenNullValue_Clones_AndSetsMemberToNull() { var bar = new CloneableBar { Value = "XYZ" }; var actual = bar.CloneWith(_ => _.Value, null); actual.Value.Should().BeNull(); actual.Should().NotBeSameAs(bar); }