public void ObjectsShuldEqual() { var flintlockDto = new FlintlockDTO() { GName = "name", AdditionalProperty = "whatever", SharedPropertyName = "prop name" }; var flintlock = new Flintlock(flintlockDto); Likeness <Flintlock, FlintlockDTO> flintFlockDtoLikeness = flintlock .AsSource().OfLikeness <FlintlockDTO>() .With(dto => dto.GName).EqualsWhen((flintlock1, dto) => flintlock1.GoodName == dto.GName) // you can write an extension method to encapsulate it .Without(dto => dto.AdditionalProperty); // assert flintFlockDtoLikeness.ShouldEqual(flintlockDto); }
public Flintlock(FlintlockDTO inflator) { this.GoodName = inflator.GName; this.SharedPropertyName = inflator.SharedPropertyName; }