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
assertions
TypeAssertionsFluent Assertions wrapper for the type.
expectedCount
intThe 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
typeAssertions
TypeAssertionsThe TypeAssertions instance on which this method extends.
propertyName
stringThe name of the property to check.
jsonPropertyName
stringThe 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
assertions
TypeAssertionsFluent Assertions wrapper for the type.
expectedCount
intThe 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
typeAssertions
TypeAssertionsThe TypeAssertions instance on which this method extends.
because
stringThe reason why the assertion is needed.
becauseArgs
object[]Optional values for formatting the reason message.
Returns
- AndConstraint<TypeAssertions>
An AndConstraint for continuing the assertion chain.