public async void Must_map_default_value(Type type, string propertyName, object expectedValue) { MapResult result = await _mapper.MapAsync(_request, type, type.GetProperty(propertyName)); Assert.That(result.ResultType, Is.EqualTo(MapResultType.ValueMapped)); Assert.That(result.Value, Is.EqualTo(expectedValue)); }
public async void Must_map_to_properties_whose_return_values_implement_iconvertible(Type type, string propertyName, object expectedValue) { MapResult result = await _mapper.MapAsync(_request, type, type.GetProperty(propertyName)); Assert.That(result.ResultType, Is.EqualTo(MapResultType.ValueMapped)); Assert.That(result.Value, Is.EqualTo(expectedValue)); }
public void Must_throw_exception(Type type, string propertyName) { Assert.That(() => _mapper.MapAsync(_request, type, type.GetProperty(propertyName)), Throws.InstanceOf <ApplicationException>()); }