public void ParseNull(CloudEventAttributeType type) => Assert.Throws <ArgumentNullException>(() => type.Parse(null !));
public void GetOrdinal_NonNullInput(CloudEventAttributeType type) => Assert.Equal(type.Ordinal, CloudEventAttributeTypes.GetOrdinal(type));
public void FormatNull(CloudEventAttributeType type) => Assert.Throws <ArgumentNullException>(() => type.Format(null));
public void ValidateIncorrectType(CloudEventAttributeType type) => Assert.Throws <ArgumentException>(() => type.Validate(new StringBuilder()));
/// <summary> /// Returns the <see cref="CloudEventAttributeTypeOrdinal"/> associated with <paramref name="type"/>, /// for convenient switching over attribute types. /// </summary> /// <param name="type">The attribute type. Must not be null.</param> /// <returns>The ordinal enum value associated with the attribute type.</returns> public static CloudEventAttributeTypeOrdinal GetOrdinal(CloudEventAttributeType type) { Validation.CheckNotNull(type, nameof(type)); return(type.Ordinal); }