コード例 #1
0
 public void ParseNull(CloudEventAttributeType type) =>
 Assert.Throws <ArgumentNullException>(() => type.Parse(null !));
コード例 #2
0
 public void GetOrdinal_NonNullInput(CloudEventAttributeType type) =>
 Assert.Equal(type.Ordinal, CloudEventAttributeTypes.GetOrdinal(type));
コード例 #3
0
 public void FormatNull(CloudEventAttributeType type) =>
 Assert.Throws <ArgumentNullException>(() => type.Format(null));
コード例 #4
0
 public void ValidateIncorrectType(CloudEventAttributeType type) =>
 Assert.Throws <ArgumentException>(() => type.Validate(new StringBuilder()));
コード例 #5
0
 /// <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);
 }