public static void ConvertFrom_InvalidId_ReturnsExpectedResult( ITypeDescriptorContext context, CatalogueItemIdTypeConverter typeConverter) { Assert.Throws <FormatException>( () => typeConverter.ConvertFrom(context, CultureInfo.InvariantCulture, "NotCatalogueItemId")); }
public static void ConvertFrom_ValidId_ReturnsExpectedResult( ITypeDescriptorContext context, CatalogueItemIdTypeConverter typeConverter) { var actualResult = typeConverter.ConvertFrom(context, CultureInfo.InvariantCulture, "1000-001"); actualResult.Should().Be(new CatalogueItemId(1000, "001")); }
public static void CanConvertFrom_ReturnsExpectedResult( Type sourceType, bool expectedResult, ITypeDescriptorContext context, CatalogueItemIdTypeConverter typeConverter) { var actualResult = typeConverter.CanConvertFrom(context, sourceType); actualResult.Should().Be(expectedResult); }