예제 #1
0
        public void EnumExtensions_ConvertTo_SourceConvertedToDestination()
        {
            SourceEnum source = SourceEnum.Value1;

            DestinationEnum destination = source.ConvertTo <DestinationEnum>();

            destination.ShouldBe(DestinationEnum.Value1);
        }
예제 #2
0
        public void EnumExtensions_ConvertTo_DestinationNotEnum_ErrorThrown()
        {
            SourceEnum source = SourceEnum.Value1;

            Should.Throw <ArgumentException>(() =>
            {
                Int32 destination = source.ConvertTo <Int32>();
            });
        }