public void CanConvertShouldReturnTrue(Type objectType) { // the converter is intended for Guids and nothing else // NOTE! CanConvert method is not called ny json.net if using with the JsonConverterAttribute // like this: [JsonConverter(typeof(StringGuidConverter))] StringGuidConverter converter = new StringGuidConverter(); converter.CanConvert(objectType).Should().BeTrue(); }
public void CanConvertShouldReturnFalse(Type objectType) { // the converter is intended for Guids and nothing else // NOTE! CanConvert method is not called by json.net if using with the JsonConverterAttribute // like this: [JsonConverter(typeof(StringGuidConverter))] StringGuidConverter converter = new StringGuidConverter(); converter.CanConvert(objectType).Should().BeFalse("Because the converter can only support Guid to string and back to Guid conversions."); }
public void CanConvertGuid() { StringGuidConverter converter = new StringGuidConverter(); converter.CanConvert(typeof(Guid)).Should().BeTrue(); }