public void EnumExtensions_ConvertTo_SourceConvertedToDestination() { SourceEnum source = SourceEnum.Value1; DestinationEnum destination = source.ConvertTo <DestinationEnum>(); destination.ShouldBe(DestinationEnum.Value1); }
public void EnumExtensions_ConvertTo_DestinationNotEnum_ErrorThrown() { SourceEnum source = SourceEnum.Value1; Should.Throw <ArgumentException>(() => { Int32 destination = source.ConvertTo <Int32>(); }); }