From a9fa531b966acd5baa4c9fb0d6b61b16b12cb692 Mon Sep 17 00:00:00 2001 From: Paul Martins <50200071+MooVC@users.noreply.github.com> Date: Sun, 26 Oct 2025 22:15:54 +0000 Subject: [PATCH 1/4] Add Monify console wrapper tests --- .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...enEqualsWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 33 ++++++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...WhenEqualsWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 33 ++++++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...nEqualsWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 33 ++++++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithIOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...nEqualsWithIOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 33 ++++++++++ ...peratorWithIOutterForArrayInnerIsCalled.cs | 35 +++++++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...yOperatorWithIOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...henEqualsWithIOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 33 ++++++++++ ...yOperatorWithIOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...eratorWithIOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ ...EqualsWithIOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 33 ++++++++++ ...eratorWithIOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...enEqualsWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 33 ++++++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...WhenEqualsWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 33 ++++++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...nEqualsWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 33 ++++++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...enEqualsWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 33 ++++++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...WhenEqualsWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 33 ++++++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...nEqualsWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 33 ++++++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...enEqualsWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 33 ++++++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...WhenEqualsWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 33 ++++++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...nEqualsWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 33 ++++++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...alityOperatorWithSimpleForArrayIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../WhenEqualsWithSimpleForArrayIsCalled.cs | 35 +++++++++++ .../WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 33 ++++++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...alityOperatorWithSimpleForArrayIsCalled.cs | 35 +++++++++++ .../WhenToStringIsCalled.cs | 19 ++++++ .../WhenConstructorIsCalled.cs | 19 ++++++ ...lityOperatorWithSimpleForStringIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../WhenEqualsWithSimpleForStringIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 33 ++++++++++ ...lityOperatorWithSimpleForStringIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...enEqualsWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 33 ++++++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...WhenEqualsWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 33 ++++++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...nEqualsWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 33 ++++++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithIOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...nEqualsWithIOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 33 ++++++++++ ...peratorWithIOutterForArrayInnerIsCalled.cs | 35 +++++++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...yOperatorWithIOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...henEqualsWithIOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 33 ++++++++++ ...yOperatorWithIOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...eratorWithIOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ ...EqualsWithIOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 33 ++++++++++ ...eratorWithIOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...enEqualsWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 33 ++++++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...WhenEqualsWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 33 ++++++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...nEqualsWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 33 ++++++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...enEqualsWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 33 ++++++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...WhenEqualsWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 33 ++++++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...nEqualsWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 33 ++++++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...enEqualsWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 33 ++++++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...WhenEqualsWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 33 ++++++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...nEqualsWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 33 ++++++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...alityOperatorWithSimpleForArrayIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../WhenEqualsWithSimpleForArrayIsCalled.cs | 35 +++++++++++ .../WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 33 ++++++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...alityOperatorWithSimpleForArrayIsCalled.cs | 35 +++++++++++ .../WhenToStringIsCalled.cs | 19 ++++++ .../WhenConstructorIsCalled.cs | 19 ++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...qualityOperatorWithSimpleForIntIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../WhenEqualsWithSimpleForIntIsCalled.cs | 35 +++++++++++ .../WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 33 ++++++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...qualityOperatorWithSimpleForIntIsCalled.cs | 35 +++++++++++ .../SimpleForIntTests/WhenToStringIsCalled.cs | 19 ++++++ .../WhenConstructorIsCalled.cs | 19 ++++++ ...lityOperatorWithSimpleForStringIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../WhenEqualsWithSimpleForStringIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 33 ++++++++++ ...lityOperatorWithSimpleForStringIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...enEqualsWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 19 ++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...WhenEqualsWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 19 ++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...nEqualsWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithIOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...nEqualsWithIOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 19 ++++++ ...peratorWithIOutterForArrayInnerIsCalled.cs | 35 +++++++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...yOperatorWithIOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...henEqualsWithIOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 19 ++++++ ...yOperatorWithIOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...eratorWithIOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ ...EqualsWithIOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 19 ++++++ ...eratorWithIOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...enEqualsWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 19 ++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...WhenEqualsWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 19 ++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...nEqualsWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...enEqualsWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 19 ++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...WhenEqualsWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 19 ++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...nEqualsWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...enEqualsWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 19 ++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...OperatorWithOutterForArrayInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 63 +++++++++++++++++++ .../InnerTests/WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...WhenEqualsWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 19 ++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...tyOperatorWithOutterForIntInnerIsCalled.cs | 35 +++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../InnerTests/WhenConstructorIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ ...nEqualsWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../InnerTests/WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 19 ++++++ ...peratorWithOutterForStringInnerIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../InnerTests/WhenToStringIsCalled.cs | 19 ++++++ .../WhenConstructorIsCalled.cs | 19 ++++++ ...henEqualityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...alityOperatorWithSimpleForArrayIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntArrayIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../WhenEqualsWithSimpleForArrayIsCalled.cs | 35 +++++++++++ .../WhenGetHashCodeIsCalled.cs | 37 +++++++++++ ...henImplicitOperatorFromIntArrayIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntArrayIsCalled.cs | 19 ++++++ ...nInequalityOperatorWithIntArrayIsCalled.cs | 46 ++++++++++++++ ...alityOperatorWithSimpleForArrayIsCalled.cs | 35 +++++++++++ .../WhenToStringIsCalled.cs | 19 ++++++ .../WhenConstructorIsCalled.cs | 19 ++++++ .../WhenEqualityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...qualityOperatorWithSimpleForIntIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualsWithIntIsCalled.cs | 33 ++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../WhenEqualsWithSimpleForIntIsCalled.cs | 35 +++++++++++ .../WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromIntIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToIntIsCalled.cs | 19 ++++++ .../WhenInequalityOperatorWithIntIsCalled.cs | 46 ++++++++++++++ ...qualityOperatorWithSimpleForIntIsCalled.cs | 35 +++++++++++ .../SimpleForIntTests/WhenToStringIsCalled.cs | 19 ++++++ .../WhenConstructorIsCalled.cs | 19 ++++++ ...lityOperatorWithSimpleForStringIsCalled.cs | 63 +++++++++++++++++++ .../WhenEqualityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenEqualsWithObjectIsCalled.cs | 47 ++++++++++++++ .../WhenEqualsWithSimpleForStringIsCalled.cs | 35 +++++++++++ .../WhenEqualsWithStringIsCalled.cs | 33 ++++++++++ .../WhenGetHashCodeIsCalled.cs | 37 +++++++++++ .../WhenImplicitOperatorFromStringIsCalled.cs | 19 ++++++ .../WhenImplicitOperatorToStringIsCalled.cs | 19 ++++++ ...lityOperatorWithSimpleForStringIsCalled.cs | 35 +++++++++++ ...henInequalityOperatorWithStringIsCalled.cs | 46 ++++++++++++++ .../WhenToStringIsCalled.cs | 19 ++++++ 636 files changed, 22644 insertions(+) create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithIOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithIOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithIOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualityOperatorWithSimpleForStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualsWithSimpleForStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenInequalityOperatorWithSimpleForStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithIOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithIOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithIOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualityOperatorWithSimpleForStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualsWithSimpleForStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenInequalityOperatorWithSimpleForStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithIOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithIOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithIOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenImplicitOperatorFromIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenConstructorIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualityOperatorWithSimpleForStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualsWithObjectIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualsWithSimpleForStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualsWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenGetHashCodeIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenImplicitOperatorFromStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenInequalityOperatorWithSimpleForStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenInequalityOperatorWithStringIsCalled.cs create mode 100644 src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenToStringIsCalled.cs diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..65afb7b --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..af98f74 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..e6ed177 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..48089c3 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..373088f --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = new OutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..c5543d8 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..483af67 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..d82632c --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..96a4e0f --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + Action act = () => _ = (int[])subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..fa403cb --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..0468888 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..d08dcd3 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..9994343 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..8ef0e35 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..fe4241f --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..6e02630 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..fc04672 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForIntInnerThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = new OutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..ae050d7 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..f9ea02a --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..f000a07 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..b4fc5a9 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + Action act = () => _ = (int)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..8ffb6c2 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..c8650ae --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..5388bb8 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..75c0690 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..711ec60 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..5eb9f80 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..95fba45 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForStringInnerThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = new OutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..4153265 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..815590d --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..351f276 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..8dd9aa7 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..2339252 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + Action act = () => _ = (string)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..f795216 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..a4bb004 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..0808771 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..5a04d7c --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + IOutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..a5732ce --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + IOutterForArray.Inner? left = default; + IOutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + IOutterForArray.Inner? left = default; + IOutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..917f69c --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + IOutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..e57ef43 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..7dd1fe8 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..64e685b --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentIOutterForArrayInnerThenReturnTrue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + object other = new IOutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..4dac6d6 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + IOutterForArray.Inner first = new(FirstValue); + IOutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + IOutterForArray.Inner first = new(FirstValue); + IOutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..577035f --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + IOutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..a54d847 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + IOutterForArray.Inner? subject = default; + + // Act + Action act = () => _ = (int[])subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..4cf0b57 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..9579f3a --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + IOutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..48c7951 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..aeaac01 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + IOutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..54b73f3 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + IOutterForInt.Inner? left = default; + IOutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + IOutterForInt.Inner? left = default; + IOutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..253b596 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + IOutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..d12e5b1 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualsWithIOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..3eb58fa --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..895828e --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentIOutterForIntInnerThenReturnTrue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + object other = new IOutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..b5c41c3 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + IOutterForInt.Inner first = new(FirstValue); + IOutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + IOutterForInt.Inner first = new(FirstValue); + IOutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..fd137f9 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + IOutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..1ebe8ab --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + IOutterForInt.Inner? subject = default; + + // Act + Action act = () => _ = (int)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..bda1915 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..d026c1c --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + IOutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..9fd7571 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..9a353f2 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + IOutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithIOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithIOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..1dd8c59 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithIOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithIOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + IOutterForString.Inner? left = default; + IOutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + IOutterForString.Inner? left = default; + IOutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..5dd53a1 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + IOutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithIOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithIOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..2873bd1 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithIOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualsWithIOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..def40d9 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentIOutterForStringInnerThenReturnTrue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + object other = new IOutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..758affa --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..da26ec1 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + IOutterForString.Inner first = new(FirstValue); + IOutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + IOutterForString.Inner first = new(FirstValue); + IOutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..d834dfb --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + IOutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..3e10583 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + IOutterForString.Inner? subject = default; + + // Act + Action act = () => _ = (string)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithIOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithIOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..c51d7aa --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithIOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithIOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..1370419 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + IOutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..600b350 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..1a8bab2 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..ef6c173 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..262fe9d --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..1af11b3 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..1d9d6fe --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = new OutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..6ca2150 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..d3b980e --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..036c615 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..605630a --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + Action act = () => _ = (int[])subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..cd09b81 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..c9bc213 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..47f0849 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..af978f9 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..a87686d --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..de2faa2 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..a17bf65 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..fa4d6b8 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForIntInnerThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = new OutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..0880123 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..dba8c77 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..358e331 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..57281d5 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + Action act = () => _ = (int)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..8019f34 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..9be1cc9 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..d0f0566 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..04049d8 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..43b0192 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..1082eb6 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..ce307c6 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForStringInnerThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = new OutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..43cb2fe --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..aa05d4a --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..0069e02 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..97c1964 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..d646f10 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + Action act = () => _ = (string)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..10dd2cd --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..2d5156e --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..ba25f2d --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..f476cae --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..5de4990 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..8edbec7 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..af0ad2f --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..6ed15e6 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = new OutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..a0fad55 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..b6405d6 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..29c9f05 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..a6c3001 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + Action act = () => _ = (int[])subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..e648e68 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..3bc24df --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..61d816e --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..f707c95 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..149d146 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..03a761f --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..dbe4969 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..35a7a58 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForIntInnerThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = new OutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..93c60f3 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..ffdd74e --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..57aebd2 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..d4c045b --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + Action act = () => _ = (int)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..9d895f8 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..1f18487 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..b9d1f8d --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..4cdad6a --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..c2f1a10 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..177a507 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..69e0e98 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForStringInnerThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = new OutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..d8e03b9 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..0b4c724 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..08a1ac9 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..99ee5a7 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..e454072 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + Action act = () => _ = (string)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..5041676 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..2e78713 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..e7b5f4e --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..6866e3d --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..14b5443 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..4591f85 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..aab51ac --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..77ae4a2 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = new OutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..92805c3 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..dacdcc5 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..4827885 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..6120636 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + Action act = () => _ = (int[])subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..75ee619 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..4ddaed5 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..b98228b --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..0635ab3 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..9ccb78f --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..97b73a1 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..b2ae061 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..7d231b0 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForIntInnerThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = new OutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..eae3a9d --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..d86cded --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..8cfcb02 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..e13f552 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + Action act = () => _ = (int)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..b4d8da8 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..d2c7929 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..5b898f6 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..fe623e8 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..394b16d --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..2c12d53 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..aa87016 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForStringInnerThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = new OutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..47b425d --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..d1a7055 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..02e5c50 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..c71d874 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..9324ccc --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + Action act = () => _ = (string)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..b77e253 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..6c45ad0 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..f78b843 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..b74768e --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Simple.SimpleForArrayTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + SimpleForArray instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..1dbeecb --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Simple.SimpleForArrayTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + SimpleForArray? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs new file mode 100644 index 0000000..dcf7fca --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Simple.SimpleForArrayTests; + +public static class WhenEqualityOperatorWithSimpleForArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + SimpleForArray? left = default; + SimpleForArray? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + SimpleForArray? left = default; + SimpleForArray right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..8086518 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Simple.SimpleForArrayTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..41476d1 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Simple.SimpleForArrayTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentSimpleForArrayThenReturnTrue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + object other = new SimpleForArray(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + SimpleForArray subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs new file mode 100644 index 0000000..a209873 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Simple.SimpleForArrayTests; + +public static class WhenEqualsWithSimpleForArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..71f764e --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Simple.SimpleForArrayTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + SimpleForArray first = new(FirstValue); + SimpleForArray second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + SimpleForArray first = new(FirstValue); + SimpleForArray second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..ad64d4a --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Simple.SimpleForArrayTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + SimpleForArray result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..221caba --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Simple.SimpleForArrayTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + SimpleForArray? subject = default; + + // Act + Action act = () => _ = (int[])subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..d2d71de --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Simple.SimpleForArrayTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + SimpleForArray? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs new file mode 100644 index 0000000..f6f4b9a --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Simple.SimpleForArrayTests; + +public static class WhenInequalityOperatorWithSimpleForArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..3c38154 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Simple.SimpleForArrayTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..275ee57 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Simple.SimpleForStringTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + SimpleForString instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualityOperatorWithSimpleForStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualityOperatorWithSimpleForStringIsCalled.cs new file mode 100644 index 0000000..8da71be --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualityOperatorWithSimpleForStringIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Classes.Simple.SimpleForStringTests; + +public static class WhenEqualityOperatorWithSimpleForStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + SimpleForString? left = default; + SimpleForString? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + SimpleForString? left = default; + SimpleForString right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..88f6e08 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Simple.SimpleForStringTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + SimpleForString? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..acdcd4f --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Classes.Simple.SimpleForStringTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentSimpleForStringThenReturnTrue() + { + // Arrange + SimpleForString subject = new(SampleValue); + object other = new SimpleForString(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + SimpleForString subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualsWithSimpleForStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualsWithSimpleForStringIsCalled.cs new file mode 100644 index 0000000..0e794c9 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualsWithSimpleForStringIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Simple.SimpleForStringTests; + +public static class WhenEqualsWithSimpleForStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..353dceb --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Simple.SimpleForStringTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..1b68d2f --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Classes.Simple.SimpleForStringTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + SimpleForString first = new(FirstValue); + SimpleForString second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + SimpleForString first = new(FirstValue); + SimpleForString second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..0aa0fcc --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Simple.SimpleForStringTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + SimpleForString result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..e69d7e2 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Classes.Simple.SimpleForStringTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + SimpleForString? subject = default; + + // Act + Action act = () => _ = (string)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenInequalityOperatorWithSimpleForStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenInequalityOperatorWithSimpleForStringIsCalled.cs new file mode 100644 index 0000000..dad703d --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenInequalityOperatorWithSimpleForStringIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Classes.Simple.SimpleForStringTests; + +public static class WhenInequalityOperatorWithSimpleForStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..6946d82 --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Classes.Simple.SimpleForStringTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + SimpleForString? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..514c31b --- /dev/null +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Classes.Simple.SimpleForStringTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..5bd8703 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..b4e74d0 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..24550ee --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..ec1b58f --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..5b91110 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = new OutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..d9a48eb --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..e8558c8 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..e03f6af --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..36de7fc --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + Action act = () => _ = (int[])subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..83136ee --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..a256ad1 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..709fc52 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..b3e7df6 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..b23cb30 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..64307ac --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..8722873 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..3c8b6d5 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForIntInnerThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = new OutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..4111531 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..209b4db --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..dab146f --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..b52ccad --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + Action act = () => _ = (int)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..c6d9d34 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..4741670 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..c5f775d --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..359f93d --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..7ae4156 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..c5b79ec --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..8bf79b9 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForStringInnerThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = new OutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..9273761 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..c6e9f96 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..c952794 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..1c78b24 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..542b04b --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + Action act = () => _ = (string)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..ab0ab55 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..c2ddc23 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..1130488 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..6c803fb --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + IOutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..33c5a7e --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + IOutterForArray.Inner? left = default; + IOutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + IOutterForArray.Inner? left = default; + IOutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..daa2ef7 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + IOutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..1eb594d --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..b2b6bba --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..2aec011 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentIOutterForArrayInnerThenReturnTrue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + object other = new IOutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..621ad09 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + IOutterForArray.Inner first = new(FirstValue); + IOutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + IOutterForArray.Inner first = new(FirstValue); + IOutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..71fd788 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + IOutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..11d72a1 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + IOutterForArray.Inner? subject = default; + + // Act + Action act = () => _ = (int[])subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..2216929 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..66cfdb5 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + IOutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..65e2abe --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..35ce23f --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + IOutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..5d3f2ea --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + IOutterForInt.Inner? left = default; + IOutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + IOutterForInt.Inner? left = default; + IOutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..1d6b7c1 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + IOutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..e7ceeaf --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualsWithIOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..4ef1e28 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..aa142c6 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentIOutterForIntInnerThenReturnTrue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + object other = new IOutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..bff2635 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + IOutterForInt.Inner first = new(FirstValue); + IOutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + IOutterForInt.Inner first = new(FirstValue); + IOutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..39fe3b2 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + IOutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..1c9d203 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + IOutterForInt.Inner? subject = default; + + // Act + Action act = () => _ = (int)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..6102572 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..0f002c1 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + IOutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..fb59a72 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..c8bf8f5 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + IOutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithIOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithIOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..0b19345 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithIOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithIOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + IOutterForString.Inner? left = default; + IOutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + IOutterForString.Inner? left = default; + IOutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..5d618f6 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + IOutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithIOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithIOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..4ce3014 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithIOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualsWithIOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..7ca96f5 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentIOutterForStringInnerThenReturnTrue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + object other = new IOutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..d6e8e5c --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..4082efb --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + IOutterForString.Inner first = new(FirstValue); + IOutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + IOutterForString.Inner first = new(FirstValue); + IOutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..3f35fcb --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + IOutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..38a24e9 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + IOutterForString.Inner? subject = default; + + // Act + Action act = () => _ = (string)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithIOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithIOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..4f93b14 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithIOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithIOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..bed26ae --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + IOutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..abe9140 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..6ccd209 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..bf16aea --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..fb01fac --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..0c4b0b3 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..17b30ef --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = new OutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..3cd83bb --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..f457fa1 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..24dc68e --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..428f687 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + Action act = () => _ = (int[])subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..8801560 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..ec692eb --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..b27547c --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..776e83b --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..285a049 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..ad21e08 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..d0ff8f3 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..d23a119 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForIntInnerThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = new OutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..30b7306 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..9a20a2e --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..09cee1f --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..258fe16 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + Action act = () => _ = (int)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..6bd3070 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..42dfb24 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..ddefa09 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..2a5895b --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..bbcc5c1 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..be04c5f --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..fc2d643 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForStringInnerThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = new OutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..14f42f2 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..4557b3c --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..fc1a754 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..1a1ab61 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..68da495 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + Action act = () => _ = (string)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..cd66cdf --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..d102d05 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..7d55327 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..65d1543 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..cf991b1 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..08f7783 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..18c1f98 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..abca852 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = new OutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..6f56b81 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..feace2f --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..dab85fa --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..e690290 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + Action act = () => _ = (int[])subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..ae37bf1 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..1d050cb --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..1393ecb --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..26a7271 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..b50663d --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..b8eb8e4 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..513d03a --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..c3339bf --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForIntInnerThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = new OutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..97ba6b3 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..2de2f3b --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..3e811a5 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..7799903 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + Action act = () => _ = (int)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..bac09df --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..e57469f --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..8ce5241 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..1d91e6c --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..23743cb --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..c109fa0 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..7a286f2 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForStringInnerThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = new OutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..0389dbc --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..7dca359 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..2d5f6d6 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..dae94da --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..43b5314 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + Action act = () => _ = (string)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..4ffa318 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..25d48d4 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..63edc3d --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..d089591 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..0e565d5 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..8b78d7e --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..ae88ccc --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..d206538 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = new OutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..9c0d71c --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..e7c0ce7 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..91c22e8 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..2ce7825 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + Action act = () => _ = (int[])subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..ca8e8c2 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..9fcee49 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..11ceb37 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..c8a238d --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..0ae3411 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..04499f5 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..6ab2ed9 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..d5b181c --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForIntInnerThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = new OutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..bdfeb8c --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..da46448 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..88dd7a8 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..b3f9fa0 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + Action act = () => _ = (int)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..c677163 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..2c3ef1b --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..6019726 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..cc8eeed --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..4bff482 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..dbcaa22 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..daf8f67 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentOutterForStringInnerThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = new OutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..10cf7c6 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..1756340 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..94c1523 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..12e3e7d --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..9605766 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + Action act = () => _ = (string)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..15d7039 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..be88e00 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..4295448 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("Inner { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..93a16df --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Simple.SimpleForArrayTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + SimpleForArray instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..4fd37ae --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Simple.SimpleForArrayTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + SimpleForArray? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs new file mode 100644 index 0000000..3b631b5 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Simple.SimpleForArrayTests; + +public static class WhenEqualityOperatorWithSimpleForArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + SimpleForArray? left = default; + SimpleForArray? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + SimpleForArray? left = default; + SimpleForArray right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..e853b24 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Simple.SimpleForArrayTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..0c07301 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Simple.SimpleForArrayTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentSimpleForArrayThenReturnTrue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + object other = new SimpleForArray(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + SimpleForArray subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs new file mode 100644 index 0000000..8caf2df --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Simple.SimpleForArrayTests; + +public static class WhenEqualsWithSimpleForArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..d1c42f0 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Simple.SimpleForArrayTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + SimpleForArray first = new(FirstValue); + SimpleForArray second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + SimpleForArray first = new(FirstValue); + SimpleForArray second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..3186d6e --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Simple.SimpleForArrayTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + SimpleForArray result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..045ead3 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Simple.SimpleForArrayTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + SimpleForArray? subject = default; + + // Act + Action act = () => _ = (int[])subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..3d4d812 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Simple.SimpleForArrayTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + SimpleForArray? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs new file mode 100644 index 0000000..88ded7b --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Simple.SimpleForArrayTests; + +public static class WhenInequalityOperatorWithSimpleForArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..3d48686 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Simple.SimpleForArrayTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("SimpleForArray { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..e949e0f --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Simple.SimpleForIntTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + SimpleForInt instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..a32ba31 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Simple.SimpleForIntTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + SimpleForInt? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs new file mode 100644 index 0000000..6b1f71a --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Simple.SimpleForIntTests; + +public static class WhenEqualityOperatorWithSimpleForIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + SimpleForInt? left = default; + SimpleForInt? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + SimpleForInt? left = default; + SimpleForInt right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForInt left = new(SampleValue); + SimpleForInt right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + SimpleForInt left = new(SampleValue); + SimpleForInt right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..47041a7 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Simple.SimpleForIntTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..de8b1cd --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Simple.SimpleForIntTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentSimpleForIntThenReturnTrue() + { + // Arrange + SimpleForInt subject = new(SampleValue); + object other = new SimpleForInt(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + SimpleForInt subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs new file mode 100644 index 0000000..4c830a6 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Simple.SimpleForIntTests; + +public static class WhenEqualsWithSimpleForIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForInt left = new(SampleValue); + SimpleForInt right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForInt left = new(SampleValue); + SimpleForInt right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..dea5f46 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Simple.SimpleForIntTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + SimpleForInt first = new(FirstValue); + SimpleForInt second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + SimpleForInt first = new(FirstValue); + SimpleForInt second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..20d0917 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Simple.SimpleForIntTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + SimpleForInt result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..9bcda2e --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Simple.SimpleForIntTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + SimpleForInt? subject = default; + + // Act + Action act = () => _ = (int)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..d44e859 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Simple.SimpleForIntTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + SimpleForInt? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs new file mode 100644 index 0000000..2890caa --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Simple.SimpleForIntTests; + +public static class WhenInequalityOperatorWithSimpleForIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForInt left = new(SampleValue); + SimpleForInt right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + SimpleForInt left = new(SampleValue); + SimpleForInt right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..0879fd3 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Simple.SimpleForIntTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("SimpleForInt { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..93200bb --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Simple.SimpleForStringTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + SimpleForString instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualityOperatorWithSimpleForStringIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualityOperatorWithSimpleForStringIsCalled.cs new file mode 100644 index 0000000..c3da25d --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualityOperatorWithSimpleForStringIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Records.Simple.SimpleForStringTests; + +public static class WhenEqualityOperatorWithSimpleForStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + SimpleForString? left = default; + SimpleForString? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + SimpleForString? left = default; + SimpleForString right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..681f458 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Simple.SimpleForStringTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + SimpleForString? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..ecd6f9b --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Records.Simple.SimpleForStringTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenReturnFalse() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject.Equals((object?)default); + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenEquivalentSimpleForStringThenReturnTrue() + { + // Arrange + SimpleForString subject = new(SampleValue); + object other = new SimpleForString(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenReturnFalse() + { + // Arrange + SimpleForString subject = new(SampleValue); + object other = string.Empty; + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualsWithSimpleForStringIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualsWithSimpleForStringIsCalled.cs new file mode 100644 index 0000000..41003b1 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualsWithSimpleForStringIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Simple.SimpleForStringTests; + +public static class WhenEqualsWithSimpleForStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..e6c26a1 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Simple.SimpleForStringTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..dec2b52 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Records.Simple.SimpleForStringTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + SimpleForString first = new(FirstValue); + SimpleForString second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + SimpleForString first = new(FirstValue); + SimpleForString second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..1ba6edb --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Simple.SimpleForStringTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + SimpleForString result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..ad6d071 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Records.Simple.SimpleForStringTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullSubjectThenThrowsArgumentNullException() + { + // Arrange + SimpleForString? subject = default; + + // Act + Action act = () => _ = (string)subject!; + + // Assert + ArgumentNullException exception = Should.Throw(act); + exception.ParamName.ShouldBe("subject"); + } + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenInequalityOperatorWithSimpleForStringIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenInequalityOperatorWithSimpleForStringIsCalled.cs new file mode 100644 index 0000000..7833ea8 --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenInequalityOperatorWithSimpleForStringIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Records.Simple.SimpleForStringTests; + +public static class WhenInequalityOperatorWithSimpleForStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..b32138e --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Records.Simple.SimpleForStringTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + SimpleForString? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..94cf9ec --- /dev/null +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Records.Simple.SimpleForStringTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnRecordDescription() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + string actual = subject.ToString(); + + // Assert + actual.ShouldBe("SimpleForString { }"); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..d33086b --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..70a26d0 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..6485df1 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..0dc691c --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..8e51905 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = new OutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..6964690 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..103d70d --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..a173ed6 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..4589897 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..f52fd9d --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..305ed94 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..7d2ee23 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..047d178 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..e238202 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..9309e5a --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..9371e0f --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..9b53ce4 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentOutterForIntInnerThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = new OutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..4f569a6 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..28a8a8a --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..aa27b6c --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..d6754a4 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..7a55c68 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..45269cc --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..e8b9dd8 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..c3aedbf --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..7d092e3 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..e3f9b19 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..8dd6ac0 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentOutterForStringInnerThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = new OutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..2c60288 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..b1a44c6 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..3829ec0 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..06d1bac --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..55adaa0 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..db55729 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..1b378e4 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..ebc2268 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InClass.OutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..5e1fa2b --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + IOutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..150e837 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + IOutterForArray.Inner? left = default; + IOutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + IOutterForArray.Inner? left = default; + IOutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..f7d9ac1 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + IOutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..6991900 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..d717d59 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..6e7dd49 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentIOutterForArrayInnerThenReturnTrue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + object other = new IOutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..347ef09 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + IOutterForArray.Inner first = new(FirstValue); + IOutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + IOutterForArray.Inner first = new(FirstValue); + IOutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..1493978 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + IOutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..e3f27ed --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..f8f98dc --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + IOutterForArray.Inner left = new(SampleValue); + IOutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..5294023 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + IOutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..31a34e9 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + IOutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..9d43595 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + IOutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..cb0c2b5 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + IOutterForInt.Inner? left = default; + IOutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + IOutterForInt.Inner? left = default; + IOutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..1c42ea7 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + IOutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..4a3e271 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualsWithIOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..374938c --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..9a853a0 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentIOutterForIntInnerThenReturnTrue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + object other = new IOutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..76a68e3 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + IOutterForInt.Inner first = new(FirstValue); + IOutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + IOutterForInt.Inner first = new(FirstValue); + IOutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..b1b8504 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + IOutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..2424dc1 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..005b80c --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + IOutterForInt.Inner left = new(SampleValue); + IOutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..541d5b7 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + IOutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..7034c80 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + IOutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..82a8d24 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + IOutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithIOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithIOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..6b01cd3 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithIOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithIOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + IOutterForString.Inner? left = default; + IOutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + IOutterForString.Inner? left = default; + IOutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..adb0f36 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + IOutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithIOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithIOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..6afc267 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithIOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualsWithIOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..83a75ec --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentIOutterForStringInnerThenReturnTrue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + object other = new IOutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..7f40f80 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..2c829c2 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + IOutterForString.Inner first = new(FirstValue); + IOutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + IOutterForString.Inner first = new(FirstValue); + IOutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..72bcfa2 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + IOutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..9417ac8 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithIOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithIOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..005ba1c --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithIOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithIOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + IOutterForString.Inner left = new(SampleValue); + IOutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..de89eec --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + IOutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..3212e91 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InInterface.IOutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + IOutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..e653610 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..bc791a4 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..aa9579e --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..35d0eaf --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..6831f01 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = new OutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..e417cb4 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..15520f7 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..d1043ad --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..c4c3766 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..b3b0ba6 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..49489bb --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..efd9575 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..72aff7e --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..3f8e61e --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..4302646 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..8b5405a --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..2a1f6f8 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentOutterForIntInnerThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = new OutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..e1e8377 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..6d445f0 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..794940d --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..7e71347 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..0475d5e --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..6c5a9d3 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..f9028e1 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..fa8d3e0 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..aaa3c3f --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..00c20ba --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..1207dfe --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentOutterForStringInnerThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = new OutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..fc94faf --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..595c618 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..9712e65 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..a4d8e62 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..eaaf8f5 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..7bc8fe3 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..3e997e1 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..65f15ba --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecord.OutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..5600d34 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..7b5bbb5 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..b5ffe9b --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..9a81ab5 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..60d3c8c --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = new OutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..663f48b --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..b282641 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..860342a --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..7b4ddb4 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..7454c4b --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..40521f4 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..6e25353 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..e6ccc7d --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..b4061d9 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..b6166e6 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..5a2ea12 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..ab798ec --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentOutterForIntInnerThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = new OutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..858a277 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..dc7544b --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..e941552 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..1906b93 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..9381ae3 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..942d0b9 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..6ab19f8 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..dac03f4 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..5b1ee73 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..b025a0a --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..dfd4da9 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentOutterForStringInnerThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = new OutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..4e84d77 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..e0d3e08 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..23766e9 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..f3aaa50 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..37b3613 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..12803a3 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..c331187 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..d6c918d --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..4f3a8b0 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForArray.Inner instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..275579b --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..1db98ab --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForArray.Inner? left = default; + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..2057d89 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..0e60e37 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = new OutterForArray.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..c66a3e1 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenEqualsWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..6d89554 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForArray.Inner first = new(FirstValue); + OutterForArray.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..df1bb0d --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForArray.Inner result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..4ab448e --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..aeddec4 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForArray.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs new file mode 100644 index 0000000..294c9eb --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForArray.Inner left = new(SampleValue); + OutterForArray.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..981f6a2 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForArray.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..d480490 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForInt.Inner instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..82d819d --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..b85c6a4 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForInt.Inner? left = default; + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..8fb5346 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..71d4148 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentOutterForIntInnerThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = new OutterForInt.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..8cb9e8d --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenEqualsWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..6f858a3 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForInt.Inner first = new(FirstValue); + OutterForInt.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..c4860df --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForInt.Inner result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..338894e --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..0af8d5e --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForInt.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs new file mode 100644 index 0000000..3a0e3e2 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForInt.Inner left = new(SampleValue); + OutterForInt.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..5b54e8b --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForInt.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..6b1b911 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + OutterForString.Inner instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..4356e07 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? left = default; + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..9a5fbb7 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..ec2c7b1 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentOutterForStringInnerThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = new OutterForString.Inner(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..c400784 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..8bd63c6 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..27a9815 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + OutterForString.Inner first = new(FirstValue); + OutterForString.Inner second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..435819b --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + OutterForString.Inner result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..242d81e --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs new file mode 100644 index 0000000..d5e5ddf --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithOutterForStringInnerIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithOutterForStringInnerIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + OutterForString.Inner left = new(SampleValue); + OutterForString.Inner right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..27bbbef --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + OutterForString.Inner? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..b4c422e --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Nested.InStruct.OutterForStringTests.InnerTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + OutterForString.Inner subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..11507cb --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Simple.SimpleForArrayTests; + +public static class WhenConstructorIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + SimpleForArray instance = new(SampleValue); + + // Act + int[] actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..5d9d064 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Simple.SimpleForArrayTests; + +public static class WhenEqualityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + SimpleForArray? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs new file mode 100644 index 0000000..e979520 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Simple.SimpleForArrayTests; + +public static class WhenEqualityOperatorWithSimpleForArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + SimpleForArray? left = default; + SimpleForArray? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + SimpleForArray? left = default; + SimpleForArray right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs new file mode 100644 index 0000000..60f5822 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Simple.SimpleForArrayTests; + +public static class WhenEqualsWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..9ccff2b --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Simple.SimpleForArrayTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentSimpleForArrayThenReturnTrue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + object other = new SimpleForArray(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + SimpleForArray subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs new file mode 100644 index 0000000..4674337 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Simple.SimpleForArrayTests; + +public static class WhenEqualsWithSimpleForArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..7af8d91 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Simple.SimpleForArrayTests; + +public static class WhenGetHashCodeIsCalled +{ + private static readonly int[] FirstValue = new[] { 7, 8, 9 }; + private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + SimpleForArray first = new(FirstValue); + SimpleForArray second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + SimpleForArray first = new(FirstValue); + SimpleForArray second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs new file mode 100644 index 0000000..2165b46 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Simple.SimpleForArrayTests; + +public static class WhenImplicitOperatorFromIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + SimpleForArray result = SampleValue; + + // Act + int[] actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs new file mode 100644 index 0000000..4a09d6c --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Simple.SimpleForArrayTests; + +public static class WhenImplicitOperatorToIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + int[] actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs new file mode 100644 index 0000000..809cb7a --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Simple.SimpleForArrayTests; + +public static class WhenInequalityOperatorWithIntArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + SimpleForArray? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs new file mode 100644 index 0000000..b2224c5 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Simple.SimpleForArrayTests; + +public static class WhenInequalityOperatorWithSimpleForArrayIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + SimpleForArray left = new(SampleValue); + SimpleForArray right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..a12d0fc --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Simple.SimpleForArrayTests; + +public static class WhenToStringIsCalled +{ + private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + SimpleForArray subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..75a0be6 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Simple.SimpleForIntTests; + +public static class WhenConstructorIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + SimpleForInt instance = new(SampleValue); + + // Act + int actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..cfb8120 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Simple.SimpleForIntTests; + +public static class WhenEqualityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + SimpleForInt? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs new file mode 100644 index 0000000..41b7fd6 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Simple.SimpleForIntTests; + +public static class WhenEqualityOperatorWithSimpleForIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + SimpleForInt? left = default; + SimpleForInt? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + SimpleForInt? left = default; + SimpleForInt right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForInt left = new(SampleValue); + SimpleForInt right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + SimpleForInt left = new(SampleValue); + SimpleForInt right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs new file mode 100644 index 0000000..3a8ed8d --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Simple.SimpleForIntTests; + +public static class WhenEqualsWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..ab92fdb --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Simple.SimpleForIntTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentSimpleForIntThenReturnTrue() + { + // Arrange + SimpleForInt subject = new(SampleValue); + object other = new SimpleForInt(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + SimpleForInt subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs new file mode 100644 index 0000000..232b7df --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Simple.SimpleForIntTests; + +public static class WhenEqualsWithSimpleForIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForInt left = new(SampleValue); + SimpleForInt right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForInt left = new(SampleValue); + SimpleForInt right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..8c3446c --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Simple.SimpleForIntTests; + +public static class WhenGetHashCodeIsCalled +{ + private const int FirstValue = 5; + private const int SecondValue = 9; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + SimpleForInt first = new(FirstValue); + SimpleForInt second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + SimpleForInt first = new(FirstValue); + SimpleForInt second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenImplicitOperatorFromIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenImplicitOperatorFromIntIsCalled.cs new file mode 100644 index 0000000..b26ce38 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenImplicitOperatorFromIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Simple.SimpleForIntTests; + +public static class WhenImplicitOperatorFromIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + SimpleForInt result = SampleValue; + + // Act + int actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs new file mode 100644 index 0000000..5a6fdd7 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Simple.SimpleForIntTests; + +public static class WhenImplicitOperatorToIntIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + int actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs new file mode 100644 index 0000000..3e0982b --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Simple.SimpleForIntTests; + +public static class WhenInequalityOperatorWithIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + SimpleForInt? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs new file mode 100644 index 0000000..7e2b04d --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Simple.SimpleForIntTests; + +public static class WhenInequalityOperatorWithSimpleForIntIsCalled +{ + private const int SampleValue = 42; + private const int DifferentValue = 84; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForInt left = new(SampleValue); + SimpleForInt right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + SimpleForInt left = new(SampleValue); + SimpleForInt right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..e24a09f --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Simple.SimpleForIntTests; + +public static class WhenToStringIsCalled +{ + private const int SampleValue = 42; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + SimpleForInt subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenConstructorIsCalled.cs new file mode 100644 index 0000000..e7884e6 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenConstructorIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Simple.SimpleForStringTests; + +public static class WhenConstructorIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenValueIsStored() + { + // Arrange + SimpleForString instance = new(SampleValue); + + // Act + string actual = instance; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualityOperatorWithSimpleForStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualityOperatorWithSimpleForStringIsCalled.cs new file mode 100644 index 0000000..301305f --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualityOperatorWithSimpleForStringIsCalled.cs @@ -0,0 +1,63 @@ +namespace Monify.Console.Structs.Simple.SimpleForStringTests; + +public static class WhenEqualityOperatorWithSimpleForStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenBothNullThenReturnTrue() + { + // Arrange + SimpleForString? left = default; + SimpleForString? right = default; + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenLeftIsNullThenReturnFalse() + { + // Arrange + SimpleForString? left = default; + SimpleForString right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(SampleValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnFalse() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(DifferentValue); + + // Act + bool actual = left == right; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..ac03d32 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Simple.SimpleForStringTests; + +public static class WhenEqualityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnFalse() + { + // Arrange + SimpleForString? subject = default; + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject == SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject == DifferentValue; + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualsWithObjectIsCalled.cs new file mode 100644 index 0000000..7b4c5b8 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualsWithObjectIsCalled.cs @@ -0,0 +1,47 @@ +namespace Monify.Console.Structs.Simple.SimpleForStringTests; + +public static class WhenEqualsWithObjectIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenNullThenThrowNullReferenceException() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + Action act = () => subject.Equals((object?)default); + + // Assert + _ = Should.Throw(act); + } + + [Fact] + public static void GivenEquivalentSimpleForStringThenReturnTrue() + { + // Arrange + SimpleForString subject = new(SampleValue); + object other = new SimpleForString(SampleValue); + + // Act + bool actual = subject.Equals(other); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentTypeThenThrowInvalidCastException() + { + // Arrange + SimpleForString subject = new(SampleValue); + object other = string.Empty; + + // Act + Action act = () => subject.Equals(other); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualsWithSimpleForStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualsWithSimpleForStringIsCalled.cs new file mode 100644 index 0000000..dce9e5b --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualsWithSimpleForStringIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Simple.SimpleForStringTests; + +public static class WhenEqualsWithSimpleForStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(SampleValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(DifferentValue); + + // Act + bool actual = left.Equals(right); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualsWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualsWithStringIsCalled.cs new file mode 100644 index 0000000..1c09a8b --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenEqualsWithStringIsCalled.cs @@ -0,0 +1,33 @@ +namespace Monify.Console.Structs.Simple.SimpleForStringTests; + +public static class WhenEqualsWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnTrue() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject.Equals(SampleValue); + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenDifferentValueThenReturnFalse() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject.Equals(DifferentValue); + + // Assert + actual.ShouldBeFalse(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenGetHashCodeIsCalled.cs new file mode 100644 index 0000000..3436c4b --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenGetHashCodeIsCalled.cs @@ -0,0 +1,37 @@ +namespace Monify.Console.Structs.Simple.SimpleForStringTests; + +public static class WhenGetHashCodeIsCalled +{ + private const string FirstValue = "Alpha"; + private const string SecondValue = "Beta"; + + [Fact] + public static void GivenSameValuesThenReturnSameHashCode() + { + // Arrange + SimpleForString first = new(FirstValue); + SimpleForString second = new(FirstValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldBe(secondHash); + } + + [Fact] + public static void GivenDifferentValuesThenReturnDifferentHashCodes() + { + // Arrange + SimpleForString first = new(FirstValue); + SimpleForString second = new(SecondValue); + + // Act + int firstHash = first.GetHashCode(); + int secondHash = second.GetHashCode(); + + // Assert + firstHash.ShouldNotBe(secondHash); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenImplicitOperatorFromStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenImplicitOperatorFromStringIsCalled.cs new file mode 100644 index 0000000..eda7e06 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenImplicitOperatorFromStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Simple.SimpleForStringTests; + +public static class WhenImplicitOperatorFromStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenReturnsEquivalentInstance() + { + // Arrange + SimpleForString result = SampleValue; + + // Act + string actual = result; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs new file mode 100644 index 0000000..52101f7 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Simple.SimpleForStringTests; + +public static class WhenImplicitOperatorToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValidSubjectThenReturnsValue() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + string actual = subject; + + // Assert + actual.ShouldBe(SampleValue); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenInequalityOperatorWithSimpleForStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenInequalityOperatorWithSimpleForStringIsCalled.cs new file mode 100644 index 0000000..90061b2 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenInequalityOperatorWithSimpleForStringIsCalled.cs @@ -0,0 +1,35 @@ +namespace Monify.Console.Structs.Simple.SimpleForStringTests; + +public static class WhenInequalityOperatorWithSimpleForStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(SampleValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValuesThenReturnTrue() + { + // Arrange + SimpleForString left = new(SampleValue); + SimpleForString right = new(DifferentValue); + + // Act + bool actual = left != right; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenInequalityOperatorWithStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenInequalityOperatorWithStringIsCalled.cs new file mode 100644 index 0000000..b61ca2d --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenInequalityOperatorWithStringIsCalled.cs @@ -0,0 +1,46 @@ +namespace Monify.Console.Structs.Simple.SimpleForStringTests; + +public static class WhenInequalityOperatorWithStringIsCalled +{ + private const string SampleValue = "Sample"; + private const string DifferentValue = "Different"; + + [Fact] + public static void GivenSubjectIsNullThenReturnTrue() + { + // Arrange + SimpleForString? subject = default; + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeTrue(); + } + + [Fact] + public static void GivenSameValueThenReturnFalse() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject != SampleValue; + + // Assert + actual.ShouldBeFalse(); + } + + [Fact] + public static void GivenDifferentValueThenReturnTrue() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + bool actual = subject != DifferentValue; + + // Assert + actual.ShouldBeTrue(); + } +} \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenToStringIsCalled.cs new file mode 100644 index 0000000..24be684 --- /dev/null +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenToStringIsCalled.cs @@ -0,0 +1,19 @@ +namespace Monify.Console.Structs.Simple.SimpleForStringTests; + +public static class WhenToStringIsCalled +{ + private const string SampleValue = "Sample"; + + [Fact] + public static void GivenValueThenThrowFormatException() + { + // Arrange + SimpleForString subject = new(SampleValue); + + // Act + Action act = () => subject.ToString(); + + // Assert + _ = Should.Throw(act); + } +} \ No newline at end of file From ff60f5499765746a6ffc144b4f7d81c6860f7f5a Mon Sep 17 00:00:00 2001 From: Paul Martins Date: Mon, 27 Oct 2025 19:39:00 +0000 Subject: [PATCH 2/4] Minor format corrections --- build/Tests.props | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 8 ++++---- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToIntIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToStringIsCalled.cs | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- ...lityOperatorWithIOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- .../WhenEqualsWithIOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 8 ++++---- ...lityOperatorWithIOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- ...ualityOperatorWithIOutterForIntInnerIsCalled.cs | 2 +- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- .../WhenEqualsWithIOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenImplicitOperatorToIntIsCalled.cs | 2 +- ...ualityOperatorWithIOutterForIntInnerIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- .../WhenImplicitOperatorToStringIsCalled.cs | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 8 ++++---- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToIntIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToStringIsCalled.cs | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 8 ++++---- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToIntIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToStringIsCalled.cs | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 8 ++++---- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToIntIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToStringIsCalled.cs | 2 +- .../SimpleForArrayTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...enEqualityOperatorWithSimpleForArrayIsCalled.cs | 14 +++++++------- .../WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithSimpleForArrayIsCalled.cs | 12 ++++++------ .../SimpleForArrayTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 8 ++++---- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...InequalityOperatorWithSimpleForArrayIsCalled.cs | 12 ++++++------ .../SimpleForArrayTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...WhenEqualityOperatorWithSimpleForIntIsCalled.cs | 2 +- .../SimpleForIntTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithSimpleForIntIsCalled.cs | 2 +- .../WhenImplicitOperatorToIntIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...enInequalityOperatorWithSimpleForIntIsCalled.cs | 2 +- .../WhenImplicitOperatorToStringIsCalled.cs | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 8 ++++---- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToIntIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToStringIsCalled.cs | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- ...lityOperatorWithIOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- .../WhenEqualsWithIOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 8 ++++---- ...lityOperatorWithIOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- ...ualityOperatorWithIOutterForIntInnerIsCalled.cs | 2 +- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- .../WhenEqualsWithIOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenImplicitOperatorToIntIsCalled.cs | 2 +- ...ualityOperatorWithIOutterForIntInnerIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- .../WhenImplicitOperatorToStringIsCalled.cs | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 8 ++++---- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToIntIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToStringIsCalled.cs | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 8 ++++---- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToIntIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToStringIsCalled.cs | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 8 ++++---- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToIntIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenImplicitOperatorToStringIsCalled.cs | 2 +- .../SimpleForArrayTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...enEqualityOperatorWithSimpleForArrayIsCalled.cs | 14 +++++++------- .../WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithSimpleForArrayIsCalled.cs | 12 ++++++------ .../SimpleForArrayTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 8 ++++---- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...InequalityOperatorWithSimpleForArrayIsCalled.cs | 12 ++++++------ .../SimpleForArrayTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...WhenEqualityOperatorWithSimpleForIntIsCalled.cs | 2 +- .../SimpleForIntTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithSimpleForIntIsCalled.cs | 2 +- .../WhenImplicitOperatorToIntIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...enInequalityOperatorWithSimpleForIntIsCalled.cs | 2 +- .../WhenImplicitOperatorToStringIsCalled.cs | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 6 +++--- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- ...lityOperatorWithIOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- .../WhenEqualsWithIOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 6 +++--- ...lityOperatorWithIOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- ...ualityOperatorWithIOutterForIntInnerIsCalled.cs | 2 +- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- .../WhenEqualsWithIOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- ...ualityOperatorWithIOutterForIntInnerIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 6 +++--- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 6 +++--- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 14 +++++++------- .../InnerTests/WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../InnerTests/WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 6 +++--- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...alityOperatorWithOutterForArrayInnerIsCalled.cs | 12 ++++++------ .../InnerTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../InnerTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithOutterForIntInnerIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...qualityOperatorWithOutterForIntInnerIsCalled.cs | 2 +- .../SimpleForArrayTests/WhenConstructorIsCalled.cs | 6 +++--- .../WhenEqualityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...enEqualityOperatorWithSimpleForArrayIsCalled.cs | 14 +++++++------- .../WhenEqualsWithIntArrayIsCalled.cs | 12 ++++++------ .../WhenEqualsWithObjectIsCalled.cs | 10 +++++----- .../WhenEqualsWithSimpleForArrayIsCalled.cs | 12 ++++++------ .../SimpleForArrayTests/WhenGetHashCodeIsCalled.cs | 12 ++++++------ .../WhenImplicitOperatorFromIntArrayIsCalled.cs | 6 +++--- .../WhenImplicitOperatorToIntArrayIsCalled.cs | 6 +++--- .../WhenInequalityOperatorWithIntArrayIsCalled.cs | 14 +++++++------- ...InequalityOperatorWithSimpleForArrayIsCalled.cs | 12 ++++++------ .../SimpleForArrayTests/WhenToStringIsCalled.cs | 4 ++-- .../WhenEqualityOperatorWithIntIsCalled.cs | 2 +- ...WhenEqualityOperatorWithSimpleForIntIsCalled.cs | 2 +- .../SimpleForIntTests/WhenEqualsWithIntIsCalled.cs | 2 +- .../WhenEqualsWithSimpleForIntIsCalled.cs | 2 +- .../WhenInequalityOperatorWithIntIsCalled.cs | 2 +- ...enInequalityOperatorWithSimpleForIntIsCalled.cs | 2 +- 349 files changed, 1243 insertions(+), 1243 deletions(-) diff --git a/build/Tests.props b/build/Tests.props index 4d46a3e..4a96ee8 100644 --- a/build/Tests.props +++ b/build/Tests.props @@ -7,7 +7,7 @@ GeneratedCodeAttribute Obsolete **/*.Designer.cs - CA1859;CA1861 + CA1859;CA1861;IDE0039 $(MSBuildProjectName.Replace('.Tests', '')) net9.0 diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index 65afb7b..4013db0 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - OutterForArray.Inner instance = new(SampleValue); + OutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index af98f74..68f1b94 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() OutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs index e6ed177..38010b4 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange OutterForArray.Inner? left = default; - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index 48089c3..179e8e7 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index 373088f..265b9d3 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act bool actual = subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenReturnFalse() public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); - object other = new OutterForArray.Inner(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); + object other = new OutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenThrowInvalidCastException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs index c5543d8..02aa82b 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualsWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index 483af67..b99f254 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(FirstValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(SecondValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index d82632c..7ebcda0 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - OutterForArray.Inner result = SampleValue; + OutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index 96a4e0f..139a577 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,7 +2,7 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullSubjectThenThrowsArgumentNullException() @@ -15,19 +15,19 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index fa403cb..35bc3d4 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() OutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs index 0468888..7c784ff 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index d08dcd3..19296b5 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenThrowFormatException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.ToString(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index 8ef0e35..94df7f3 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs index fe4241f..ff575ca 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index 6e02630..6c28f44 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs index ae050d7..eeefec9 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenEqualsWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs index b4fc5a9..af030ea 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index 8ffb6c2..8a5e808 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs index c8650ae..dc516fb 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs index 2339252..ddfa059 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index 5a04d7c..db29dcf 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - IOutterForArray.Inner instance = new(SampleValue); + IOutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs index a5732ce..5586f91 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualityOperatorWithIOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange IOutterForArray.Inner? left = default; - IOutterForArray.Inner right = new(SampleValue); + IOutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(SampleValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(DifferentValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index 917f69c..dc3b71b 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() IOutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs index e57ef43..7352bda 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualsWithIOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(SampleValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(DifferentValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index 7dd1fe8..bd0efc2 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index 64e685b..9b38db1 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenReturnFalse() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act bool actual = subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenReturnFalse() public static void GivenEquivalentIOutterForArrayInnerThenReturnTrue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); - object other = new IOutterForArray.Inner(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); + object other = new IOutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentIOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenThrowInvalidCastException() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index 4dac6d6..630356f 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - IOutterForArray.Inner first = new(FirstValue); - IOutterForArray.Inner second = new(FirstValue); + IOutterForArray.Inner first = new(_firstValue); + IOutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - IOutterForArray.Inner first = new(FirstValue); - IOutterForArray.Inner second = new(SecondValue); + IOutterForArray.Inner first = new(_firstValue); + IOutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index 577035f..a2396a7 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - IOutterForArray.Inner result = SampleValue; + IOutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index a54d847..6e1a2af 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,7 +2,7 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullSubjectThenThrowsArgumentNullException() @@ -15,19 +15,19 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs index 4cf0b57..47530f3 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenInequalityOperatorWithIOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(SampleValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(DifferentValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index 9579f3a..3fe0d74 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() IOutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 48c7951..a696113 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenThrowFormatException() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.ToString(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs index 54b73f3..8bf48b9 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenEqualityOperatorWithIOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index 253b596..22b819e 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs index d12e5b1..dc5e2b1 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenEqualsWithIOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index 3eb58fa..258c1f9 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs index 1ebe8ab..75df0df 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs index bda1915..fa28392 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenInequalityOperatorWithIOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index d026c1c..efd89d4 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs index 3e10583..931ef44 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index 1a8bab2..2b40d88 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - OutterForArray.Inner instance = new(SampleValue); + OutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index ef6c173..b3e48a8 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() OutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs index 262fe9d..80c3a44 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange OutterForArray.Inner? left = default; - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index 1af11b3..2483409 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index 1d9d6fe..edc6324 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act bool actual = subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenReturnFalse() public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); - object other = new OutterForArray.Inner(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); + object other = new OutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenThrowInvalidCastException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs index 6ca2150..bd4369c 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualsWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index d3b980e..bbc12d1 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(FirstValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(SecondValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index 036c615..efe939c 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - OutterForArray.Inner result = SampleValue; + OutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index 605630a..a6f7698 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,7 +2,7 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullSubjectThenThrowsArgumentNullException() @@ -15,19 +15,19 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index cd09b81..0842dee 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() OutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs index c9bc213..5d3d149 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 47f0849..be6e656 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenThrowFormatException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.ToString(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index a87686d..7c40a36 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs index de2faa2..a9cc255 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index a17bf65..7156b8c 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs index 0880123..3d454dd 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenEqualsWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs index 57281d5..dc6ec60 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index 8019f34..0d8d0f4 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs index 9be1cc9..5174329 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs index d646f10..4f98de8 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index f476cae..e43d707 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - OutterForArray.Inner instance = new(SampleValue); + OutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index 5de4990..9d7bcd0 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() OutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs index 8edbec7..6410ebf 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange OutterForArray.Inner? left = default; - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index af0ad2f..a9d097b 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index 6ed15e6..066d9f6 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act bool actual = subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenReturnFalse() public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); - object other = new OutterForArray.Inner(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); + object other = new OutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenThrowInvalidCastException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs index a0fad55..6c29fc5 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualsWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index b6405d6..f1c40a1 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(FirstValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(SecondValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index 29c9f05..af0c15d 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - OutterForArray.Inner result = SampleValue; + OutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index a6c3001..adf8961 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,7 +2,7 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullSubjectThenThrowsArgumentNullException() @@ -15,19 +15,19 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index e648e68..2b82276 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() OutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs index 3bc24df..b1e37e5 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 61d816e..d7c9724 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenThrowFormatException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.ToString(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index 149d146..9993c11 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs index 03a761f..50a7ce1 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index dbe4969..660487f 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs index 93c60f3..603539a 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenEqualsWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs index d4c045b..98dad76 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index 9d895f8..89d8131 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs index 1f18487..d8a9ea8 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs index e454072..0ff4e00 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index 6866e3d..da2d0f4 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - OutterForArray.Inner instance = new(SampleValue); + OutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index 14b5443..ba6991b 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() OutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs index 4591f85..ec4b94e 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange OutterForArray.Inner? left = default; - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index aab51ac..54b46e4 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index 77ae4a2..5fb9ad7 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act bool actual = subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenReturnFalse() public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); - object other = new OutterForArray.Inner(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); + object other = new OutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenThrowInvalidCastException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs index 92805c3..e4f3385 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualsWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index dacdcc5..b8bdd30 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(FirstValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(SecondValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index 4827885..affa79b 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - OutterForArray.Inner result = SampleValue; + OutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index 6120636..022106d 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,7 +2,7 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullSubjectThenThrowsArgumentNullException() @@ -15,19 +15,19 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index 75ee619..5cd6430 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() OutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs index 4ddaed5..201b918 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index b98228b..aa8b7b5 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenThrowFormatException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.ToString(); diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index 9ccb78f..2cd1402 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs index 97b73a1..30b12ce 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index b2ae061..091f82d 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs index eae3a9d..8aaecc4 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenEqualsWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs index e13f552..14e7572 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index b4d8da8..bef40d6 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs index d2c7929..a0ff6cf 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs index 9324ccc..a6df8c0 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs index b74768e..08d5573 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Classes.Simple.SimpleForArrayTests; public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - SimpleForArray instance = new(SampleValue); + SimpleForArray instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index 1dbeecb..b33a168 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Simple.SimpleForArrayTests; public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() SimpleForArray? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs index dcf7fca..de2188f 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Simple.SimpleForArrayTests; public static class WhenEqualityOperatorWithSimpleForArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange SimpleForArray? left = default; - SimpleForArray right = new(SampleValue); + SimpleForArray right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(SampleValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(DifferentValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs index 8086518..8091f5b 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Classes.Simple.SimpleForArrayTests; public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs index 41476d1..b2da9c6 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Classes.Simple.SimpleForArrayTests; public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenReturnFalse() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act bool actual = subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenReturnFalse() public static void GivenEquivalentSimpleForArrayThenReturnTrue() { // Arrange - SimpleForArray subject = new(SampleValue); - object other = new SimpleForArray(SampleValue); + SimpleForArray subject = new(_sampleValue); + object other = new SimpleForArray(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentSimpleForArrayThenReturnTrue() public static void GivenDifferentTypeThenThrowInvalidCastException() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs index a209873..0da3057 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Simple.SimpleForArrayTests; public static class WhenEqualsWithSimpleForArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(SampleValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(DifferentValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs index 71f764e..d9322f1 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Simple.SimpleForArrayTests; public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - SimpleForArray first = new(FirstValue); - SimpleForArray second = new(FirstValue); + SimpleForArray first = new(_firstValue); + SimpleForArray second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - SimpleForArray first = new(FirstValue); - SimpleForArray second = new(SecondValue); + SimpleForArray first = new(_firstValue); + SimpleForArray second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index ad64d4a..dce0568 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Classes.Simple.SimpleForArrayTests; public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - SimpleForArray result = SampleValue; + SimpleForArray result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs index 221caba..755dfd8 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,7 +2,7 @@ namespace Monify.Console.Classes.Simple.SimpleForArrayTests; public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullSubjectThenThrowsArgumentNullException() @@ -15,19 +15,19 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index d2d71de..ae61624 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Simple.SimpleForArrayTests; public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() SimpleForArray? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs index f6f4b9a..2d856a3 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Classes.Simple.SimpleForArrayTests; public static class WhenInequalityOperatorWithSimpleForArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(SampleValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(DifferentValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs index 3c38154..172f448 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Classes.Simple.SimpleForArrayTests; public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenThrowFormatException() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act Action act = () => subject.ToString(); diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs index 884a359..b94e864 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Simple.SimpleForIntTests; public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 101; private const int DifferentValue = 202; + private const int SampleValue = 101; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs index 848eb15..2a0369d 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Simple.SimpleForIntTests; public static class WhenEqualityOperatorWithSimpleForIntIsCalled { - private const int SampleValue = 14; private const int DifferentValue = 17; + private const int SampleValue = 14; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs index bfa1059..cf9d5fb 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Simple.SimpleForIntTests; public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 36; private const int DifferentValue = 12; + private const int SampleValue = 36; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs index 5200bcc..506e48f 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Simple.SimpleForIntTests; public static class WhenEqualsWithSimpleForIntIsCalled { - private const int SampleValue = 51; private const int DifferentValue = 5; + private const int SampleValue = 51; [Fact] public static void GivenOtherHasSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs index 42906e9..6e48d22 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs index 59868ec..bf9d622 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Simple.SimpleForIntTests; public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 7; private const int DifferentValue = 9; + private const int SampleValue = 7; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs index 7d17868..8b7f62c 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Classes.Simple.SimpleForIntTests; public static class WhenInequalityOperatorWithSimpleForIntIsCalled { - private const int SampleValue = 63; private const int DifferentValue = 64; + private const int SampleValue = 63; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs index e69d7e2..0f2b86c 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index 5bd8703..e07fc3d 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - OutterForArray.Inner instance = new(SampleValue); + OutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index b4e74d0..7b1faea 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() OutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs index 24550ee..6613df2 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange OutterForArray.Inner? left = default; - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index ec1b58f..5f65afe 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index 5b91110..d01b44e 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act bool actual = subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenReturnFalse() public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); - object other = new OutterForArray.Inner(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); + object other = new OutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs index d9a48eb..acc71f6 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualsWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index e8558c8..8ab75d9 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(FirstValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(SecondValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index e03f6af..dd18ba2 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - OutterForArray.Inner result = SampleValue; + OutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index 36de7fc..7000f18 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,7 +2,7 @@ namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullSubjectThenThrowsArgumentNullException() @@ -15,19 +15,19 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index 83136ee..d3296ea 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() OutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs index a256ad1..127f7f2 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 709fc52..21d81df 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Records.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnRecordDescription() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act string actual = subject.ToString(); diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index b23cb30..acfcc6f 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs index 64307ac..2483b07 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index 8722873..636c75e 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs index 4111531..7122570 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenEqualsWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs index b52ccad..2791ca3 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index c6d9d34..70a5c13 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs index 4741670..34a4169 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs index 542b04b..a903a21 100644 --- a/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InClass/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index 6c803fb..6473226 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - IOutterForArray.Inner instance = new(SampleValue); + IOutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs index 33c5a7e..9f4d305 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualityOperatorWithIOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange IOutterForArray.Inner? left = default; - IOutterForArray.Inner right = new(SampleValue); + IOutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(SampleValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(DifferentValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index daa2ef7..7740b0c 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() IOutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs index 1eb594d..2433eba 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualsWithIOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(SampleValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(DifferentValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index b2b6bba..2dde2c8 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index 2aec011..305383c 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenReturnFalse() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act bool actual = subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenReturnFalse() public static void GivenEquivalentIOutterForArrayInnerThenReturnTrue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); - object other = new IOutterForArray.Inner(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); + object other = new IOutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentIOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenReturnFalse() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index 621ad09..7a50981 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - IOutterForArray.Inner first = new(FirstValue); - IOutterForArray.Inner second = new(FirstValue); + IOutterForArray.Inner first = new(_firstValue); + IOutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - IOutterForArray.Inner first = new(FirstValue); - IOutterForArray.Inner second = new(SecondValue); + IOutterForArray.Inner first = new(_firstValue); + IOutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index 71fd788..b5591df 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - IOutterForArray.Inner result = SampleValue; + IOutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index 11d72a1..8ed5412 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,7 +2,7 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullSubjectThenThrowsArgumentNullException() @@ -15,19 +15,19 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs index 2216929..24d831b 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenInequalityOperatorWithIOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(SampleValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(DifferentValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index 66cfdb5..d43788c 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() IOutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 65e2abe..a71e0b4 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnRecordDescription() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act string actual = subject.ToString(); diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs index 5d3f2ea..38235f5 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenEqualityOperatorWithIOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index 1d6b7c1..fdd9206 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs index e7ceeaf..58f5397 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenEqualsWithIOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index 4ef1e28..6a3fc7f 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs index 1c9d203..cad179f 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs index 6102572..6c1cbb7 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenInequalityOperatorWithIOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index 0f002c1..74fb2a8 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs index 38a24e9..f6cd281 100644 --- a/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InInterface/IOutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index 6ccd209..28c0a10 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - OutterForArray.Inner instance = new(SampleValue); + OutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index bf16aea..e220c44 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() OutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs index fb01fac..0ec2601 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange OutterForArray.Inner? left = default; - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index 0c4b0b3..7ae2270 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index 17b30ef..c641cd5 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act bool actual = subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenReturnFalse() public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); - object other = new OutterForArray.Inner(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); + object other = new OutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs index 3cd83bb..780c95b 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualsWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index f457fa1..ff94a4a 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(FirstValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(SecondValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index 24dc68e..1cfaeda 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - OutterForArray.Inner result = SampleValue; + OutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index 428f687..0f8e9a5 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,7 +2,7 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullSubjectThenThrowsArgumentNullException() @@ -15,19 +15,19 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index 8801560..3d8db6f 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() OutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs index ec692eb..8603901 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index b27547c..b5f9b87 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnRecordDescription() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act string actual = subject.ToString(); diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index 285a049..58ac849 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs index ad21e08..0faa8d6 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index d0ff8f3..70c74ff 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs index 30b7306..74ac333 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenEqualsWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs index 258fe16..faf21e6 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index 6bd3070..69506bc 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs index 42dfb24..d0e5a87 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs index 68da495..3a27da5 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecord/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index 65d1543..6b17d37 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - OutterForArray.Inner instance = new(SampleValue); + OutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index cf991b1..0283ce8 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() OutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs index 08f7783..b4952d6 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange OutterForArray.Inner? left = default; - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index 18c1f98..a21ae1b 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index abca852..53b055c 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act bool actual = subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenReturnFalse() public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); - object other = new OutterForArray.Inner(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); + object other = new OutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs index 6f56b81..8046333 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualsWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index feace2f..d4fe9f4 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(FirstValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(SecondValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index dab85fa..e1bf6ec 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - OutterForArray.Inner result = SampleValue; + OutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index e690290..91ea60a 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,7 +2,7 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullSubjectThenThrowsArgumentNullException() @@ -15,19 +15,19 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index ae37bf1..0c615e9 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() OutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs index 1d050cb..f3de426 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 1393ecb..fccc5f8 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnRecordDescription() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act string actual = subject.ToString(); diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index b50663d..6ef252d 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs index b8eb8e4..b7a012f 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index 513d03a..b6ba974 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs index 97ba6b3..9ff153a 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenEqualsWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs index 7799903..74e6c1a 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index bac09df..fcb75dc 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs index e57469f..5446785 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs index 43b5314..e62b634 100644 --- a/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index d089591..bb23a1b 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - OutterForArray.Inner instance = new(SampleValue); + OutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index 0e565d5..c8890f6 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() OutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs index 8b78d7e..af9bef4 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange OutterForArray.Inner? left = default; - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index ae88ccc..63f6052 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index d206538..2019cc0 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act bool actual = subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenReturnFalse() public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); - object other = new OutterForArray.Inner(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); + object other = new OutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs index 9c0d71c..5a5ab0a 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualsWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index e7c0ce7..76ba9c7 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(FirstValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(SecondValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index 91c22e8..b32a647 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - OutterForArray.Inner result = SampleValue; + OutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index 2ce7825..40d8bee 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,7 +2,7 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullSubjectThenThrowsArgumentNullException() @@ -15,19 +15,19 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index ca8e8c2..a06e654 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() OutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs index 9fcee49..5af43df 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 11ceb37..a690380 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnRecordDescription() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act string actual = subject.ToString(); diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index 0ae3411..19a99c0 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs index 04499f5..4317fd2 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index 6ab2ed9..0da6d59 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs index bdfeb8c..58e7eb0 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenEqualsWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs index b3f9fa0..438bae8 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenImplicitOperatorToIntIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index c677163..bb31bb4 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs index 2c3ef1b..97a9574 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs index 9605766..fb802f9 100644 --- a/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Nested/InStruct/OutterForStringTests/InnerTests/WhenImplicitOperatorToStringIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs index 93a16df..5fe711f 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Records.Simple.SimpleForArrayTests; public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - SimpleForArray instance = new(SampleValue); + SimpleForArray instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index 4fd37ae..52b80e3 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Simple.SimpleForArrayTests; public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() SimpleForArray? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs index 3b631b5..1c7e33f 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Simple.SimpleForArrayTests; public static class WhenEqualityOperatorWithSimpleForArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange SimpleForArray? left = default; - SimpleForArray right = new(SampleValue); + SimpleForArray right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(SampleValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(DifferentValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs index e853b24..2d61007 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Records.Simple.SimpleForArrayTests; public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs index 0c07301..601a892 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Records.Simple.SimpleForArrayTests; public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenReturnFalse() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act bool actual = subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenReturnFalse() public static void GivenEquivalentSimpleForArrayThenReturnTrue() { // Arrange - SimpleForArray subject = new(SampleValue); - object other = new SimpleForArray(SampleValue); + SimpleForArray subject = new(_sampleValue); + object other = new SimpleForArray(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentSimpleForArrayThenReturnTrue() public static void GivenDifferentTypeThenReturnFalse() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs index 8caf2df..ce23eb2 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Simple.SimpleForArrayTests; public static class WhenEqualsWithSimpleForArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(SampleValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(DifferentValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs index d1c42f0..e099892 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Simple.SimpleForArrayTests; public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - SimpleForArray first = new(FirstValue); - SimpleForArray second = new(FirstValue); + SimpleForArray first = new(_firstValue); + SimpleForArray second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - SimpleForArray first = new(FirstValue); - SimpleForArray second = new(SecondValue); + SimpleForArray first = new(_firstValue); + SimpleForArray second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index 3186d6e..0b1d0b5 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Records.Simple.SimpleForArrayTests; public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - SimpleForArray result = SampleValue; + SimpleForArray result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs index 045ead3..65d1acd 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,7 +2,7 @@ namespace Monify.Console.Records.Simple.SimpleForArrayTests; public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullSubjectThenThrowsArgumentNullException() @@ -15,19 +15,19 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index 3d4d812..7f32dd8 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Simple.SimpleForArrayTests; public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() SimpleForArray? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs index 88ded7b..c96365d 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Records.Simple.SimpleForArrayTests; public static class WhenInequalityOperatorWithSimpleForArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(SampleValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(DifferentValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs index 3d48686..e6cecc5 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Records.Simple.SimpleForArrayTests; public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnRecordDescription() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act string actual = subject.ToString(); diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs index a32ba31..d37b159 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Simple.SimpleForIntTests; public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs index 6b1f71a..8b514af 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Simple.SimpleForIntTests; public static class WhenEqualityOperatorWithSimpleForIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs index 47041a7..3721e85 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Simple.SimpleForIntTests; public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs index 4c830a6..3fc32eb 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Simple.SimpleForIntTests; public static class WhenEqualsWithSimpleForIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs index 9bcda2e..174d354 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenImplicitOperatorToIntIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs index d44e859..f6a740c 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Simple.SimpleForIntTests; public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs index 2890caa..e48da6a 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Records.Simple.SimpleForIntTests; public static class WhenInequalityOperatorWithSimpleForIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs index ad6d071..846fedf 100644 --- a/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Records/Simple/SimpleForStringTests/WhenImplicitOperatorToStringIsCalled.cs @@ -15,7 +15,7 @@ public static void GivenNullSubjectThenThrowsArgumentNullException() // Assert ArgumentNullException exception = Should.Throw(act); - exception.ParamName.ShouldBe("subject"); + exception.ParamName.ShouldBe(nameof(subject)); } [Fact] diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index d33086b..4c087ec 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - OutterForArray.Inner instance = new(SampleValue); + OutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index 70a26d0..de2cbab 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() OutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs index 6485df1..4e54acd 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange OutterForArray.Inner? left = default; - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index 0dc691c..812aef2 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index 8e51905..268c28d 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenThrowNullReferenceException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenThrowNullReferenceException() public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); - object other = new OutterForArray.Inner(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); + object other = new OutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenThrowInvalidCastException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs index 6964690..9e7e353 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenEqualsWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index 103d70d..d6e1ca6 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(FirstValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(SecondValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index a173ed6..66a7536 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - OutterForArray.Inner result = SampleValue; + OutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index 4589897..74fbd36 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index f52fd9d..bd1b317 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() OutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs index 305ed94..f919007 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 7d2ee23..128cbd3 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenThrowFormatException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.ToString(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index e238202..964202e 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs index 9309e5a..3a513e4 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index 9371e0f..43d462c 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs index 4f569a6..ab8a8cd 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenEqualsWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index 7a55c68..86a4418 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs index 45269cc..8e5d066 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index 5e1fa2b..957163d 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - IOutterForArray.Inner instance = new(SampleValue); + IOutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs index 150e837..ceaf799 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualityOperatorWithIOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange IOutterForArray.Inner? left = default; - IOutterForArray.Inner right = new(SampleValue); + IOutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(SampleValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(DifferentValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index f7d9ac1..fdd9f1c 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() IOutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs index 6991900..852a4b5 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualsWithIOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(SampleValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(DifferentValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index d717d59..937b0b4 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index 6e7dd49..149e0ac 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenThrowNullReferenceException() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenThrowNullReferenceException() public static void GivenEquivalentIOutterForArrayInnerThenReturnTrue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); - object other = new IOutterForArray.Inner(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); + object other = new IOutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentIOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenThrowInvalidCastException() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index 347ef09..2c13a63 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - IOutterForArray.Inner first = new(FirstValue); - IOutterForArray.Inner second = new(FirstValue); + IOutterForArray.Inner first = new(_firstValue); + IOutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - IOutterForArray.Inner first = new(FirstValue); - IOutterForArray.Inner second = new(SecondValue); + IOutterForArray.Inner first = new(_firstValue); + IOutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index 1493978..179a01d 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - IOutterForArray.Inner result = SampleValue; + IOutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index e3f27ed..2d89b36 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs index f8f98dc..c731d48 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenInequalityOperatorWithIOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(SampleValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - IOutterForArray.Inner left = new(SampleValue); - IOutterForArray.Inner right = new(DifferentValue); + IOutterForArray.Inner left = new(_sampleValue); + IOutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index 5294023..8916528 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() IOutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 31a34e9..23ccf93 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenThrowFormatException() { // Arrange - IOutterForArray.Inner subject = new(SampleValue); + IOutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.ToString(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs index cb0c2b5..fc7da0e 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenEqualityOperatorWithIOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index 1c42ea7..5dcda31 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs index 4a3e271..f2e8d95 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenEqualsWithIOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index 374938c..ec5d9b3 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs index 005b80c..47bc50d 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenInequalityOperatorWithIOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index 541d5b7..19d63a8 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index e653610..685b3f1 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - OutterForArray.Inner instance = new(SampleValue); + OutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index bc791a4..46b4376 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() OutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs index aa9579e..330ab6a 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange OutterForArray.Inner? left = default; - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index 35d0eaf..676bd85 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index 6831f01..d38ef74 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenThrowNullReferenceException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenThrowNullReferenceException() public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); - object other = new OutterForArray.Inner(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); + object other = new OutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenThrowInvalidCastException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs index e417cb4..d9eb62c 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenEqualsWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index 15520f7..31b6741 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(FirstValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(SecondValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index d1043ad..87dd862 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - OutterForArray.Inner result = SampleValue; + OutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index c4c3766..1436569 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index b3b0ba6..9395098 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() OutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs index 49489bb..d5c206a 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index efd9575..1ab5aa9 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenThrowFormatException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.ToString(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index 3f8e61e..d44224d 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs index 4302646..970ce3d 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index 8b5405a..bd56fa4 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs index e1e8377..8c1d0b7 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenEqualsWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index 0475d5e..d48ae85 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs index 6c5a9d3..d09575a 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index 5600d34..d4b1c87 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - OutterForArray.Inner instance = new(SampleValue); + OutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index 7b5bbb5..3c711ee 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() OutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs index b5ffe9b..6deeee9 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange OutterForArray.Inner? left = default; - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index 9a81ab5..8cfe647 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index 60d3c8c..839ce9d 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenThrowNullReferenceException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenThrowNullReferenceException() public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); - object other = new OutterForArray.Inner(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); + object other = new OutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenThrowInvalidCastException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs index 663f48b..3721ef8 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenEqualsWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index b282641..c29292f 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(FirstValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(SecondValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index 860342a..e3ae9ef 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - OutterForArray.Inner result = SampleValue; + OutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index 7b4ddb4..b4265d0 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index 7454c4b..9b5506f 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() OutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs index 40521f4..0659efc 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 6e25353..4d608c1 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenThrowFormatException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.ToString(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index b4061d9..b5df8e9 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs index b6166e6..e1b25e2 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index 5a2ea12..38f8117 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs index 858a277..9ae6a48 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenEqualsWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index 9381ae3..2ca6d86 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs index 942d0b9..ae7f9ab 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs index 4f3a8b0..28ff4a5 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - OutterForArray.Inner instance = new(SampleValue); + OutterForArray.Inner instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index 275579b..005ffb9 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() OutterForArray.Inner? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs index 1db98ab..d4d22fc 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange OutterForArray.Inner? left = default; - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs index 2057d89..23fa17d 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs index 0e60e37..7168f05 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenThrowNullReferenceException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenThrowNullReferenceException() public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); - object other = new OutterForArray.Inner(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); + object other = new OutterForArray.Inner(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentOutterForArrayInnerThenReturnTrue() public static void GivenDifferentTypeThenThrowInvalidCastException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs index c66a3e1..0ac51c6 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenEqualsWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenEqualsWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs index 6d89554..b95ea35 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(FirstValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - OutterForArray.Inner first = new(FirstValue); - OutterForArray.Inner second = new(SecondValue); + OutterForArray.Inner first = new(_firstValue); + OutterForArray.Inner second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index df1bb0d..2bbb495 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - OutterForArray.Inner result = SampleValue; + OutterForArray.Inner result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs index 4ab448e..8a62d6c 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index aeddec4..3ff898c 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() OutterForArray.Inner? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs index 294c9eb..b5e5bfa 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenInequalityOperatorWithOutterForArrayInnerIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenInequalityOperatorWithOutterForArrayInnerIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(SampleValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - OutterForArray.Inner left = new(SampleValue); - OutterForArray.Inner right = new(DifferentValue); + OutterForArray.Inner left = new(_sampleValue); + OutterForArray.Inner right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 981f6a2..cdb8487 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenThrowFormatException() { // Arrange - OutterForArray.Inner subject = new(SampleValue); + OutterForArray.Inner subject = new(_sampleValue); // Act Action act = () => subject.ToString(); diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs index 82d819d..d5d26e9 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs index b85c6a4..535a0f2 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenEqualityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs index 8fb5346..e1ae1ee 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs index 8cb9e8d..69ea5f1 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenEqualsWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenEqualsWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs index 0af8d5e..c04c18f 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs index 3a0e3e2..1b1b1f4 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenInequalityOperatorWithOutterForIntInnerIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenInequalityOperatorWithOutterForIntInnerIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs index 11507cb..e9eacba 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenConstructorIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Simple.SimpleForArrayTests; public static class WhenConstructorIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenValueIsStored() { // Arrange - SimpleForArray instance = new(SampleValue); + SimpleForArray instance = new(_sampleValue); // Act int[] actual = instance; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs index 5d9d064..9359272 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Simple.SimpleForArrayTests; public static class WhenEqualityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnFalse() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnFalse() SimpleForArray? subject = default; // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeFalse(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject == SampleValue; + bool actual = subject == _sampleValue; // Assert actual.ShouldBeTrue(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject == DifferentValue; + bool actual = subject == _differentValue; // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs index e979520..0197492 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualityOperatorWithSimpleForArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Simple.SimpleForArrayTests; public static class WhenEqualityOperatorWithSimpleForArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenBothNullThenReturnTrue() @@ -24,7 +24,7 @@ public static void GivenLeftIsNullThenReturnFalse() { // Arrange SimpleForArray? left = default; - SimpleForArray right = new(SampleValue); + SimpleForArray right = new(_sampleValue); // Act bool actual = left == right; @@ -37,8 +37,8 @@ public static void GivenLeftIsNullThenReturnFalse() public static void GivenSameValueThenReturnTrue() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(SampleValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_sampleValue); // Act bool actual = left == right; @@ -51,8 +51,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValuesThenReturnFalse() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(DifferentValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_differentValue); // Act bool actual = left == right; diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs index 60f5822..3dbfae7 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithIntArrayIsCalled.cs @@ -2,17 +2,17 @@ namespace Monify.Console.Structs.Simple.SimpleForArrayTests; public static class WhenEqualsWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject.Equals(SampleValue); + bool actual = subject.Equals(_sampleValue); // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject.Equals(DifferentValue); + bool actual = subject.Equals(_differentValue); // Assert actual.ShouldBeFalse(); diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs index 9ccff2b..eb8c363 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithObjectIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Structs.Simple.SimpleForArrayTests; public static class WhenEqualsWithObjectIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenNullThenThrowNullReferenceException() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act Action act = () => subject.Equals((object?)default); @@ -21,8 +21,8 @@ public static void GivenNullThenThrowNullReferenceException() public static void GivenEquivalentSimpleForArrayThenReturnTrue() { // Arrange - SimpleForArray subject = new(SampleValue); - object other = new SimpleForArray(SampleValue); + SimpleForArray subject = new(_sampleValue); + object other = new SimpleForArray(_sampleValue); // Act bool actual = subject.Equals(other); @@ -35,7 +35,7 @@ public static void GivenEquivalentSimpleForArrayThenReturnTrue() public static void GivenDifferentTypeThenThrowInvalidCastException() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); object other = string.Empty; // Act diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs index 4674337..1e3cff9 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenEqualsWithSimpleForArrayIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Simple.SimpleForArrayTests; public static class WhenEqualsWithSimpleForArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnTrue() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(SampleValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_sampleValue); // Act bool actual = left.Equals(right); @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnTrue() public static void GivenDifferentValueThenReturnFalse() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(DifferentValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_differentValue); // Act bool actual = left.Equals(right); diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs index 7af8d91..0b03908 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenGetHashCodeIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Simple.SimpleForArrayTests; public static class WhenGetHashCodeIsCalled { - private static readonly int[] FirstValue = new[] { 7, 8, 9 }; - private static readonly int[] SecondValue = new[] { 10, 11, 12 }; + private static readonly int[] _firstValue = [7, 8, 9]; + private static readonly int[] _secondValue = [10, 11, 12]; [Fact] public static void GivenSameValuesThenReturnSameHashCode() { // Arrange - SimpleForArray first = new(FirstValue); - SimpleForArray second = new(FirstValue); + SimpleForArray first = new(_firstValue); + SimpleForArray second = new(_firstValue); // Act int firstHash = first.GetHashCode(); @@ -24,8 +24,8 @@ public static void GivenSameValuesThenReturnSameHashCode() public static void GivenDifferentValuesThenReturnDifferentHashCodes() { // Arrange - SimpleForArray first = new(FirstValue); - SimpleForArray second = new(SecondValue); + SimpleForArray first = new(_firstValue); + SimpleForArray second = new(_secondValue); // Act int firstHash = first.GetHashCode(); diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs index 2165b46..0f4250b 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorFromIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Simple.SimpleForArrayTests; public static class WhenImplicitOperatorFromIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenReturnsEquivalentInstance() { // Arrange - SimpleForArray result = SampleValue; + SimpleForArray result = _sampleValue; // Act int[] actual = result; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs index 4a09d6c..c183d33 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenImplicitOperatorToIntArrayIsCalled.cs @@ -2,18 +2,18 @@ namespace Monify.Console.Structs.Simple.SimpleForArrayTests; public static class WhenImplicitOperatorToIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValidSubjectThenReturnsValue() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act int[] actual = subject; // Assert - actual.ShouldBe(SampleValue); + actual.ShouldBe(_sampleValue); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs index 809cb7a..c805340 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithIntArrayIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Simple.SimpleForArrayTests; public static class WhenInequalityOperatorWithIntArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSubjectIsNullThenReturnTrue() @@ -12,7 +12,7 @@ public static void GivenSubjectIsNullThenReturnTrue() SimpleForArray? subject = default; // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeTrue(); @@ -22,10 +22,10 @@ public static void GivenSubjectIsNullThenReturnTrue() public static void GivenSameValueThenReturnFalse() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject != SampleValue; + bool actual = subject != _sampleValue; // Assert actual.ShouldBeFalse(); @@ -35,10 +35,10 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValueThenReturnTrue() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act - bool actual = subject != DifferentValue; + bool actual = subject != _differentValue; // Assert actual.ShouldBeTrue(); diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs index b2224c5..0a2bd8d 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenInequalityOperatorWithSimpleForArrayIsCalled.cs @@ -2,15 +2,15 @@ namespace Monify.Console.Structs.Simple.SimpleForArrayTests; public static class WhenInequalityOperatorWithSimpleForArrayIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; - private static readonly int[] DifferentValue = new[] { 4, 5, 6 }; + private static readonly int[] _differentValue = [4, 5, 6]; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenSameValueThenReturnFalse() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(SampleValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_sampleValue); // Act bool actual = left != right; @@ -23,8 +23,8 @@ public static void GivenSameValueThenReturnFalse() public static void GivenDifferentValuesThenReturnTrue() { // Arrange - SimpleForArray left = new(SampleValue); - SimpleForArray right = new(DifferentValue); + SimpleForArray left = new(_sampleValue); + SimpleForArray right = new(_differentValue); // Act bool actual = left != right; diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs index a12d0fc..aa5ad1c 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs @@ -2,13 +2,13 @@ namespace Monify.Console.Structs.Simple.SimpleForArrayTests; public static class WhenToStringIsCalled { - private static readonly int[] SampleValue = new[] { 1, 2, 3 }; + private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] public static void GivenValueThenThrowFormatException() { // Arrange - SimpleForArray subject = new(SampleValue); + SimpleForArray subject = new(_sampleValue); // Act Action act = () => subject.ToString(); diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs index cfb8120..413043c 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Simple.SimpleForIntTests; public static class WhenEqualityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnFalse() diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs index 41b7fd6..236242f 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualityOperatorWithSimpleForIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Simple.SimpleForIntTests; public static class WhenEqualityOperatorWithSimpleForIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenBothNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs index 3a8ed8d..8b8d1db 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Simple.SimpleForIntTests; public static class WhenEqualsWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs index 232b7df..c5e96af 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenEqualsWithSimpleForIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Simple.SimpleForIntTests; public static class WhenEqualsWithSimpleForIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs index 3e0982b..5a8556e 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Simple.SimpleForIntTests; public static class WhenInequalityOperatorWithIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSubjectIsNullThenReturnTrue() diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs index 7e2b04d..a0a0a8c 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenInequalityOperatorWithSimpleForIntIsCalled.cs @@ -2,8 +2,8 @@ namespace Monify.Console.Structs.Simple.SimpleForIntTests; public static class WhenInequalityOperatorWithSimpleForIntIsCalled { - private const int SampleValue = 42; private const int DifferentValue = 84; + private const int SampleValue = 42; [Fact] public static void GivenSameValueThenReturnFalse() From 004a6bd7dc56efc5930578b3bae8ac8d3078c7db Mon Sep 17 00:00:00 2001 From: Paul Martins Date: Mon, 27 Oct 2025 20:45:50 +0000 Subject: [PATCH 3/4] - `ToString` no longer throws a `FormatException`. --- CHANGELOG.md | 6 ++++++ .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../OutterForIntTests/InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../OutterForIntTests/InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../OutterForIntTests/InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../OutterForIntTests/InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../Simple/SimpleForArrayTests/WhenToStringIsCalled.cs | 7 ++++--- .../Simple/SimpleForIntTests/WhenToStringIsCalled.cs | 7 ++++--- .../Simple/SimpleForStringTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../OutterForIntTests/InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../OutterForIntTests/InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../OutterForIntTests/InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../OutterForIntTests/InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../InnerTests/WhenToStringIsCalled.cs | 7 ++++--- .../Simple/SimpleForArrayTests/WhenToStringIsCalled.cs | 7 ++++--- .../Simple/SimpleForIntTests/WhenToStringIsCalled.cs | 7 ++++--- .../Simple/SimpleForStringTests/WhenToStringIsCalled.cs | 7 ++++--- .../Declarations/Classes/Nested.InClass.Expected.cs | 2 +- .../Declarations/Classes/Nested.InInterface.Expected.cs | 2 +- .../Declarations/Classes/Nested.InRecord.Expected.cs | 2 +- .../Classes/Nested.InRecordStruct.Expected.cs | 2 +- .../Declarations/Classes/Nested.InStruct.Expected.cs | 2 +- .../Snippets/Declarations/Classes/Simple.Expected.cs | 2 +- .../Declarations/Records/Nested.InClass.Expected.cs | 2 +- .../Declarations/Records/Nested.InInterface.Expected.cs | 2 +- .../Declarations/Records/Nested.InRecord.Expected.cs | 2 +- .../Records/Nested.InRecordStruct.Expected.cs | 2 +- .../Declarations/Records/Nested.InStruct.Expected.cs | 2 +- .../Declarations/Structs/Nested.InClass.Expected.cs | 2 +- .../Declarations/Structs/Nested.InInterface.Expected.cs | 2 +- .../Declarations/Structs/Nested.InRecord.Expected.cs | 2 +- .../Structs/Nested.InRecordStruct.Expected.cs | 2 +- .../Declarations/Structs/Nested.InStruct.Expected.cs | 2 +- .../Snippets/Declarations/Structs/Simple.Expected.cs | 2 +- src/Monify/Semantics/ISymbolExtensions.IsAttribute.cs | 8 ++++---- src/Monify/Strategies/ToStringStrategy.cs | 6 +++--- src/Monify/TypeGenerator.cs | 4 ++-- 57 files changed, 176 insertions(+), 134 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9cc583..4472302 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to Monify will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +# [1.1.3] - TBC + +## Fixed +- Equality checks involing an encapsulated array containing identical values now yield true (#19). +- `ToString` no longer throws a `FormatException`. + # [1.1.2] - 2025-10-20 ## Fixed diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 19296b5..da96198 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { + private const string Expected = "Inner { System.Int32[] }"; private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForArray.Inner subject = new(_sampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs index 5388bb8..4ca6fb8 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenToStringIsCalled { + private const string Expected = "Inner { 42 }"; private const int SampleValue = 42; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueThenTheExpectedStringIsReturned() { // Arrange OutterForInt.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs index 0808771..3db4579 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InClass.OutterForStringTests.InnerTests; public static class WhenToStringIsCalled { + private const string Expected = $"Inner {{ {SampleValue} }}"; private const string SampleValue = "Sample"; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForString.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index a696113..d5e4a6f 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenToStringIsCalled { + private const string Expected = "Inner { System.Int32[] }"; private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange IOutterForArray.Inner subject = new(_sampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs index 9fd7571..3f39b87 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenToStringIsCalled { + private const string Expected = "Inner { 42 }"; private const int SampleValue = 42; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange IOutterForInt.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs index 600b350..9400901 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InInterface.IOutterForStringTests.InnerT public static class WhenToStringIsCalled { + private const string Expected = $"Inner {{ {SampleValue} }}"; private const string SampleValue = "Sample"; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange IOutterForString.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index be6e656..467ace2 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { + private const string Expected = "Inner { System.Int32[] }"; private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForArray.Inner subject = new(_sampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs index d0f0566..2080306 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenToStringIsCalled { + private const string Expected = "Inner { 42 }"; private const int SampleValue = 42; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForInt.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs index ba25f2d..773cdb6 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InRecord.OutterForStringTests.InnerTests public static class WhenToStringIsCalled { + private const string Expected = $"Inner {{ {SampleValue} }}"; private const string SampleValue = "Sample"; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForString.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index d7c9724..5cfae1b 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenToStringIsCalled { + private const string Expected = "Inner { System.Int32[] }"; private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForArray.Inner subject = new(_sampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs index b9d1f8d..d24947f 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenToStringIsCalled { + private const string Expected = "Inner { 42 }"; private const int SampleValue = 42; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForInt.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs index e7b5f4e..72b0122 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InRecordStruct.OutterForStringTests.Inne public static class WhenToStringIsCalled { + private const string Expected = $"Inner {{ {SampleValue} }}"; private const string SampleValue = "Sample"; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForString.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index aa8b7b5..f9a4719 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { + private const string Expected = "Inner { System.Int32[] }"; private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForArray.Inner subject = new(_sampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs index 5b898f6..e8f31d9 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenToStringIsCalled { + private const string Expected = "Inner { 42 }"; private const int SampleValue = 42; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForInt.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs index f78b843..4687ca9 100644 --- a/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Nested.InStruct.OutterForStringTests.InnerTests public static class WhenToStringIsCalled { + private const string Expected = $"Inner {{ {SampleValue} }}"; private const string SampleValue = "Sample"; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForString.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs index 172f448..edbeb68 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Simple.SimpleForArrayTests; public static class WhenToStringIsCalled { + private const string Expected = "SimpleForArray { System.Int32[] }"; private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange SimpleForArray subject = new(_sampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenToStringIsCalled.cs index 6a42a34..68da357 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForIntTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Simple.SimpleForIntTests; public static class WhenToStringIsCalled { + private const string Expected = "SimpleForInt { 91 }"; private const int SampleValue = 91; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange SimpleForInt subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenToStringIsCalled.cs index 514c31b..bc5688e 100644 --- a/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Classes/Simple/SimpleForStringTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Classes.Simple.SimpleForStringTests; public static class WhenToStringIsCalled { + private const string Expected = $"SimpleForString {{ {SampleValue} }}"; private const string SampleValue = "Sample"; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange SimpleForString subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 128cbd3..0bfb647 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { + private const string Expected = "Inner { System.Int32[] }"; private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForArray.Inner subject = new(_sampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs index e8b9dd8..b5b94da 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForIntTests.InnerTests; public static class WhenToStringIsCalled { + private const string Expected = "Inner { 42 }"; private const int SampleValue = 42; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForInt.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs index ebc2268..30b5bb8 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InClass/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InClass.OutterForStringTests.InnerTests; public static class WhenToStringIsCalled { + private const string Expected = $"Inner {{ {SampleValue} }}"; private const string SampleValue = "Sample"; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForString.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 23ccf93..512e591 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForArrayTests.InnerTe public static class WhenToStringIsCalled { + private const string Expected = "Inner { System.Int32[] }"; private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange IOutterForArray.Inner subject = new(_sampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs index 7034c80..401aa58 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForIntTests.InnerTest public static class WhenToStringIsCalled { + private const string Expected = "Inner { 42 }"; private const int SampleValue = 42; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange IOutterForInt.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs index 3212e91..8dc363b 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InInterface/IOutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InInterface.IOutterForStringTests.InnerT public static class WhenToStringIsCalled { + private const string Expected = $"Inner {{ {SampleValue} }}"; private const string SampleValue = "Sample"; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange IOutterForString.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 1ab5aa9..320bc66 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { + private const string Expected = "Inner { System.Int32[] }"; private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForArray.Inner subject = new(_sampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs index f9028e1..5af58cb 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForIntTests.InnerTests; public static class WhenToStringIsCalled { + private const string Expected = "Inner { 42 }"; private const int SampleValue = 42; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForInt.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs index 65f15ba..e627b6d 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecord/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InRecord.OutterForStringTests.InnerTests public static class WhenToStringIsCalled { + private const string Expected = $"Inner {{ {SampleValue} }}"; private const string SampleValue = "Sample"; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForString.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index 4d608c1..93f5164 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForArrayTests.Inner public static class WhenToStringIsCalled { + private const string Expected = "Inner { System.Int32[] }"; private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForArray.Inner subject = new(_sampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs index 6ab19f8..9d3ea15 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForIntTests.InnerTe public static class WhenToStringIsCalled { + private const string Expected = "Inner { 42 }"; private const int SampleValue = 42; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForInt.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs index d6c918d..26cf28b 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InRecordStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InRecordStruct.OutterForStringTests.Inne public static class WhenToStringIsCalled { + private const string Expected = $"Inner {{ {SampleValue} }}"; private const string SampleValue = "Sample"; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForString.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs index cdb8487..8ecb142 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForArrayTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForArrayTests.InnerTests; public static class WhenToStringIsCalled { + private const string Expected = "Inner { System.Int32[] }"; private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForArray.Inner subject = new(_sampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs index 5b54e8b..e742f9c 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForIntTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForIntTests.InnerTests; public static class WhenToStringIsCalled { + private const string Expected = "Inner { 42 }"; private const int SampleValue = 42; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForInt.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs index b4c422e..3ec40bc 100644 --- a/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Nested/InStruct/OutterForStringTests/InnerTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Nested.InStruct.OutterForStringTests.InnerTests public static class WhenToStringIsCalled { + private const string Expected = $"Inner {{ {SampleValue} }}"; private const string SampleValue = "Sample"; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange OutterForString.Inner subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs index aa5ad1c..c536cb1 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForArrayTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Simple.SimpleForArrayTests; public static class WhenToStringIsCalled { + private const string Expected = "SimpleForArray { System.Int32[] }"; private static readonly int[] _sampleValue = [1, 2, 3]; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange SimpleForArray subject = new(_sampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenToStringIsCalled.cs index e24a09f..71b6926 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForIntTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Simple.SimpleForIntTests; public static class WhenToStringIsCalled { + private const string Expected = "SimpleForInt { 42 }"; private const int SampleValue = 42; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange SimpleForInt subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenToStringIsCalled.cs b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenToStringIsCalled.cs index 24be684..ea8808a 100644 --- a/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenToStringIsCalled.cs +++ b/src/Monify.Console.Tests/Structs/Simple/SimpleForStringTests/WhenToStringIsCalled.cs @@ -2,18 +2,19 @@ namespace Monify.Console.Structs.Simple.SimpleForStringTests; public static class WhenToStringIsCalled { + private const string Expected = $"SimpleForString {{ {SampleValue} }}"; private const string SampleValue = "Sample"; [Fact] - public static void GivenValueThenThrowFormatException() + public static void GivenValueTheExpectedStringIsReturned() { // Arrange SimpleForString subject = new(SampleValue); // Act - Action act = () => subject.ToString(); + string result = subject.ToString(); // Assert - _ = Should.Throw(act); + result.ShouldBe(Expected); } } \ No newline at end of file diff --git a/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InClass.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InClass.Expected.cs index b609758..0b3d504 100644 --- a/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InClass.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InClass.Expected.cs @@ -397,7 +397,7 @@ sealed partial class Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InInterface.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InInterface.Expected.cs index edde3ec..25320d2 100644 --- a/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InInterface.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InInterface.Expected.cs @@ -397,7 +397,7 @@ sealed partial class Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InRecord.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InRecord.Expected.cs index b04355f..088b248 100644 --- a/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InRecord.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InRecord.Expected.cs @@ -397,7 +397,7 @@ sealed partial class Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InRecordStruct.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InRecordStruct.Expected.cs index bc569de..d0806ca 100644 --- a/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InRecordStruct.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InRecordStruct.Expected.cs @@ -397,7 +397,7 @@ sealed partial class Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InStruct.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InStruct.Expected.cs index f26e832..e757d39 100644 --- a/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InStruct.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Classes/Nested.InStruct.Expected.cs @@ -397,7 +397,7 @@ sealed partial class Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Classes/Simple.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Classes/Simple.Expected.cs index 28f9012..69c4406 100644 --- a/src/Monify.Tests/Snippets/Declarations/Classes/Simple.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Classes/Simple.Expected.cs @@ -357,7 +357,7 @@ sealed partial class Simple { public override string ToString() { - return string.Format("Simple { {0} }", _value); + return string.Format("Simple {{ {0} }}", _value); } } diff --git a/src/Monify.Tests/Snippets/Declarations/Records/Nested.InClass.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Records/Nested.InClass.Expected.cs index 0be192b..60aa21d 100644 --- a/src/Monify.Tests/Snippets/Declarations/Records/Nested.InClass.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Records/Nested.InClass.Expected.cs @@ -397,7 +397,7 @@ sealed partial record Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Records/Nested.InInterface.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Records/Nested.InInterface.Expected.cs index 809a49e..e6ec599 100644 --- a/src/Monify.Tests/Snippets/Declarations/Records/Nested.InInterface.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Records/Nested.InInterface.Expected.cs @@ -397,7 +397,7 @@ sealed partial record Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Records/Nested.InRecord.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Records/Nested.InRecord.Expected.cs index b2fded0..d462494 100644 --- a/src/Monify.Tests/Snippets/Declarations/Records/Nested.InRecord.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Records/Nested.InRecord.Expected.cs @@ -397,7 +397,7 @@ sealed partial record Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Records/Nested.InRecordStruct.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Records/Nested.InRecordStruct.Expected.cs index cc486d7..355fbef 100644 --- a/src/Monify.Tests/Snippets/Declarations/Records/Nested.InRecordStruct.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Records/Nested.InRecordStruct.Expected.cs @@ -397,7 +397,7 @@ sealed partial record Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Records/Nested.InStruct.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Records/Nested.InStruct.Expected.cs index 90be44f..4ccce13 100644 --- a/src/Monify.Tests/Snippets/Declarations/Records/Nested.InStruct.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Records/Nested.InStruct.Expected.cs @@ -397,7 +397,7 @@ sealed partial record Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InClass.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InClass.Expected.cs index 7bb90ca..5e80f4c 100644 --- a/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InClass.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InClass.Expected.cs @@ -397,7 +397,7 @@ readonly partial struct Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InInterface.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InInterface.Expected.cs index 0ac032d..ac76da1 100644 --- a/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InInterface.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InInterface.Expected.cs @@ -397,7 +397,7 @@ readonly partial struct Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InRecord.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InRecord.Expected.cs index a54a962..3f3917c 100644 --- a/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InRecord.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InRecord.Expected.cs @@ -397,7 +397,7 @@ readonly partial struct Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InRecordStruct.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InRecordStruct.Expected.cs index a01fafd..1c9b501 100644 --- a/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InRecordStruct.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InRecordStruct.Expected.cs @@ -397,7 +397,7 @@ readonly partial struct Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InStruct.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InStruct.Expected.cs index a0fe201..b943108 100644 --- a/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InStruct.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Structs/Nested.InStruct.Expected.cs @@ -397,7 +397,7 @@ readonly partial struct Inner { public override string ToString() { - return string.Format("Inner { {0} }", _value); + return string.Format("Inner {{ {0} }}", _value); } } } diff --git a/src/Monify.Tests/Snippets/Declarations/Structs/Simple.Expected.cs b/src/Monify.Tests/Snippets/Declarations/Structs/Simple.Expected.cs index f165a45..5432154 100644 --- a/src/Monify.Tests/Snippets/Declarations/Structs/Simple.Expected.cs +++ b/src/Monify.Tests/Snippets/Declarations/Structs/Simple.Expected.cs @@ -357,7 +357,7 @@ partial struct Simple { public override string ToString() { - return string.Format("Simple { {0} }", _value); + return string.Format("Simple {{ {0} }}", _value); } } diff --git a/src/Monify/Semantics/ISymbolExtensions.IsAttribute.cs b/src/Monify/Semantics/ISymbolExtensions.IsAttribute.cs index bf9e660..f004510 100644 --- a/src/Monify/Semantics/ISymbolExtensions.IsAttribute.cs +++ b/src/Monify/Semantics/ISymbolExtensions.IsAttribute.cs @@ -7,11 +7,11 @@ /// internal static partial class ISymbolExtensions { - private static readonly SymbolDisplayFormat fullyQualifiedFormat = new( + private static readonly SymbolDisplayFormat _fullyQualifiedFormat = new( typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces, genericsOptions: SymbolDisplayGenericsOptions.None); - private static readonly SymbolDisplayFormat minimallyQualifiedFormat = new( + private static readonly SymbolDisplayFormat _minimallyQualifiedFormat = new( typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameOnly, genericsOptions: SymbolDisplayGenericsOptions.None); @@ -35,12 +35,12 @@ public static bool IsAttribute(this ISymbol? subject, string name) bool IsGlobal() { - return subject.ContainingNamespace.IsGlobalNamespace && subject.ToDisplayString(minimallyQualifiedFormat) == name; + return subject.ContainingNamespace.IsGlobalNamespace && subject.ToDisplayString(_minimallyQualifiedFormat) == name; } bool IsQualified() { - string name = subject.ToDisplayString(fullyQualifiedFormat); + string name = subject.ToDisplayString(_fullyQualifiedFormat); return name == qualifiedName || name == fullyQualifiedName || name == globalQualifiedName; } diff --git a/src/Monify/Strategies/ToStringStrategy.cs b/src/Monify/Strategies/ToStringStrategy.cs index bbfc16a..45b32af 100644 --- a/src/Monify/Strategies/ToStringStrategy.cs +++ b/src/Monify/Strategies/ToStringStrategy.cs @@ -16,12 +16,12 @@ public IEnumerable Generate(Subject subject) yield break; } - string code = $$""" - {{subject.Declaration}} {{subject.Qualification}} + string code = $$$""" + {{{subject.Declaration}}} {{{subject.Qualification}}} { public override string ToString() { - return string.Format("{{subject.Name}} { {0} }", {{FieldStrategy.Name}}); + return string.Format("{{{subject.Name}}} {{ {0} }}", {{{FieldStrategy.Name}}}); } } """; diff --git a/src/Monify/TypeGenerator.cs b/src/Monify/TypeGenerator.cs index 6f30648..d61699f 100644 --- a/src/Monify/TypeGenerator.cs +++ b/src/Monify/TypeGenerator.cs @@ -13,7 +13,7 @@ public sealed class TypeGenerator : IIncrementalGenerator { - private static readonly IStrategy[] strategies = new IStrategy[] + private static readonly IStrategy[] _strategies = new IStrategy[] { new ConstructorStrategy(), new ConvertFromStrategy(), @@ -64,7 +64,7 @@ private static void Generate(SourceProductionContext context, Subject? subject) Dictionary files = new(); #endif - foreach (IStrategy strategy in strategies) + foreach (IStrategy strategy in _strategies) { IEnumerable sources = strategy.Generate(subject); From 25de740097605c76dabdf037f3707f280f4919eb Mon Sep 17 00:00:00 2001 From: Paul Martins Date: Mon, 27 Oct 2025 21:32:58 +0000 Subject: [PATCH 4/4] - Equality checks involing an encapsulated array containing identical values now yield true (#19). --- src/Monify/Model/Subject.cs | 8 ++++++ .../INamedTypeSymbolExtensions.ToSubject.cs | 1 + .../ITypeSymbolExtensions.IsSequence.cs | 25 +++++++++++++++++++ src/Monify/TypeGenerator.cs | 12 ++++++++- 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/Monify/Semantics/ITypeSymbolExtensions.IsSequence.cs diff --git a/src/Monify/Model/Subject.cs b/src/Monify/Model/Subject.cs index 9e98366..7e26ab7 100644 --- a/src/Monify/Model/Subject.cs +++ b/src/Monify/Model/Subject.cs @@ -146,6 +146,14 @@ internal sealed partial class Subject /// public bool IsGlobal => string.IsNullOrEmpty(Namespace); + /// + /// Gets or sets a value indicating whether or not the encapsulated type is deemed to be a sequence. + /// + /// + /// The value indicating whether or not the encapsulated type is deemed to be a sequence. + /// + public bool IsSequence { get; set; } + /// /// Gets or sets the name of the subject. /// diff --git a/src/Monify/Semantics/INamedTypeSymbolExtensions.ToSubject.cs b/src/Monify/Semantics/INamedTypeSymbolExtensions.ToSubject.cs index 3c1638c..e4a5e29 100644 --- a/src/Monify/Semantics/INamedTypeSymbolExtensions.ToSubject.cs +++ b/src/Monify/Semantics/INamedTypeSymbolExtensions.ToSubject.cs @@ -64,6 +64,7 @@ internal static partial class INamedTypeSymbolExtensions HasInequalityOperatorForValue = subject.HasInequalityOperator(type: value), IsEquatableToSelf = subject.IsEquatable(compilation), IsEquatableToValue = subject.IsEquatable(compilation, type: value), + IsSequence = value.IsSequence(), Name = subject.Name, Namespace = @namespace, Nesting = nesting, diff --git a/src/Monify/Semantics/ITypeSymbolExtensions.IsSequence.cs b/src/Monify/Semantics/ITypeSymbolExtensions.IsSequence.cs new file mode 100644 index 0000000..bd5ca52 --- /dev/null +++ b/src/Monify/Semantics/ITypeSymbolExtensions.IsSequence.cs @@ -0,0 +1,25 @@ +namespace Monify.Semantics; + +using Microsoft.CodeAnalysis; + +/// +/// Provides extensions relating to . +/// +internal static class ITypeSymbolExtensions +{ + /// + /// Determines whether or not the represents a sequence. + /// + /// The type to check. + /// if the represents a sequence, otherwise . + public static bool IsSequence(this ITypeSymbol type) + { + static bool IsEnumerable(INamedTypeSymbol @interface) + { + return @interface.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T + || @interface.SpecialType == SpecialType.System_Collections_IEnumerable; + } + + return type.SpecialType != SpecialType.System_String && (type is IArrayTypeSymbol || type.AllInterfaces.Any(IsEnumerable)); + } +} \ No newline at end of file diff --git a/src/Monify/TypeGenerator.cs b/src/Monify/TypeGenerator.cs index d61699f..2d3a1ab 100644 --- a/src/Monify/TypeGenerator.cs +++ b/src/Monify/TypeGenerator.cs @@ -29,7 +29,7 @@ public sealed class TypeGenerator subject => subject.Qualification), new EquatableStrategy( subject => !subject.IsEquatableToValue, - subject => $"global::System.Collections.Generic.EqualityComparer<{subject.Value}>.Default.Equals({FieldStrategy.Name}, other)", + GetEqualityOperator, subject => !subject.HasEquatableForValue, "Value", subject => subject.Value), @@ -83,6 +83,16 @@ private static void Generate(SourceProductionContext context, Subject? subject) } } + private static string GetEqualityOperator(Subject subject) + { + if (subject.IsSequence) + { + return $"global::Monify.Internal.SequenceEqualityComparer.Default.Equals({FieldStrategy.Name}, other)"; + } + + return $"global::System.Collections.Generic.EqualityComparer<{subject.Value}>.Default.Equals({FieldStrategy.Name}, other)"; + } + private static string GetHint(Source source, Subject subject) { string name = subject.Name;