public void CopyPropertiesTo_ShouldntCopyProps_WhenUnavailable(int idValue) { var dest = new DestinationDTO(); var src = new SourceDTO() { DifferentId = idValue }; src.CopyPropertiesTo(dest); dest.DifferentId.Should().Be(null); }
public void CopyPropertiesTo_ShouldCopyProps_WhenAvailable(int idValue) { var dest = new DestinationDTO(); var src = new SourceDTO() { Id = idValue }; src.CopyPropertiesTo(dest); dest.Id.Should().Be(idValue); }
public void CopyPropertiesTo_ShouldntCopyProps_WhenUnwrittable(int idValue) { var dest = new DestinationDTO(); var src = new SourceDTO() { UnwritableIdOnDest = idValue }; src.CopyPropertiesTo(dest); src.UnwritableIdOnDest.Should().Be(idValue); dest.UnwritableIdOnDest.Should().Be(null); }