public void When_Getter_Throws_Exception_Bubbles_Up() { TypeAdapterConfig <SimplePocoThatThrowsOnGet, SimpleDto> .NewConfig().Compile(); var poco = new SimplePocoThatThrowsOnGet { Id = new Guid(), Name = "TestName" }; Should.Throw <InvalidOperationException>(() => TypeAdapter.Adapt <SimplePocoThatThrowsOnGet, SimpleDto>(poco)); }
public void When_Getter_Throws_Exception_Bubbles_Up() { TypeAdapterConfig<SimplePocoThatThrowsOnGet, SimpleDto>.NewConfig().Compile(); var poco = new SimplePocoThatThrowsOnGet { Id = new Guid(), Name = "TestName" }; Assert.Throws<InvalidOperationException>(() => TypeAdapter.Adapt<SimplePocoThatThrowsOnGet, SimpleDto>(poco)); }