Class TypeFluentAssertions
- Namespace
- OneImlx.Test.FluentAssertions
- Assembly
- OneImlx.Test.dll
The fluent assertion extension methods for Type.
public static class TypeFluentAssertions
- Inheritance
-
TypeFluentAssertions
- Inherited Members
Methods
HaveConstantCount(TypeAssertions, int)
Asserts that the specified type has the defined number of constants.
public static AndConstraint<TypeAssertions> HaveConstantCount(this TypeAssertions assertions, int expectedCount)
Parameters
assertionsTypeAssertionsFluent Assertions wrapper for the type.
expectedCountintThe expected number of constants.
Returns
- AndConstraint<TypeAssertions>
An AndConstraint object for method chaining.
HaveJsonProperty(TypeAssertions, string, string)
Asserts that a specified property of a type is decorated with the JsonPropertyNameAttribute having a specific name.
public static AndConstraint<TypeAssertions> HaveJsonProperty(this TypeAssertions typeAssertions, string propertyName, string jsonPropertyName)
Parameters
typeAssertionsTypeAssertionsThe TypeAssertions instance on which this method extends.
propertyNamestringThe name of the property to check.
jsonPropertyNamestringThe expected name value of the JsonPropertyNameAttribute.
Returns
- AndConstraint<TypeAssertions>
An AndConstraint for continuing the assertion chain.
HavePropertyCount(TypeAssertions, int)
Asserts that the specified type has the defined number of properties.
public static AndConstraint<TypeAssertions> HavePropertyCount(this TypeAssertions assertions, int expectedCount)
Parameters
assertionsTypeAssertionsFluent Assertions wrapper for the type.
expectedCountintThe expected number of properties.
Returns
- AndConstraint<TypeAssertions>
An AndConstraint object for method chaining.
HaveSnakeCaseJsonNames(TypeAssertions, string, params object[])
Asserts that all public properties are either decorated with JsonPropertyNameAttribute with a correct name, or with JsonIgnoreAttribute.
public static AndConstraint<TypeAssertions> HaveSnakeCaseJsonNames(this TypeAssertions typeAssertions, string because = "", params object[] becauseArgs)
Parameters
typeAssertionsTypeAssertionsThe TypeAssertions instance on which this method extends.
becausestringThe reason why the assertion is needed.
becauseArgsobject[]Optional values for formatting the reason message.
Returns
- AndConstraint<TypeAssertions>
An AndConstraint for continuing the assertion chain.