Currently, the CurrencyInputExtensionsTest that is the unit test for Lib9c.GraphQL.Extensions.CurrencyInputExtensions covered one case only. We should expand cases of that.
Change [Fact] to [Theory] with [MemberData]
-[Fact]
+[Theory]
+[MemberData("method-name")]
public void ToCurrency_ShouldConvertCorrectly()
Implement GetTestData_For_ToCurrency_ShouldConvertCorrectly and apply to argument of [MemberData]
public static IEnumerable<object[]> GetTestData_For_ToCurrency_ShouldConvertCorrectly()
{
yield return new object[]
{
/* CurrencyInput */,
/* Currency */
};
}
[Theory]
[MemberData(nameof(GetTestData_For_ToCurrency_ShouldConvertCorrectly))]
public void ToCurrency_ShouldConvertCorrectly(
CurrencyInput currencyInput,
Currency expectedCurrency)
{
//
}
Expand test cases
public static IEnumerable<object[]> GetTestData_For_ToCurrency_ShouldConvertCorrectly()
{
yield return new object[]
{
/* CurrencyInput */,
/* Currency */
};
+ yield return new object[]
+ {
+ /* CurrencyInput */,
+ /* Currency */
+ };
}
Currently, the
CurrencyInputExtensionsTestthat is the unit test forLib9c.GraphQL.Extensions.CurrencyInputExtensionscovered one case only. We should expand cases of that.Change [Fact] to [Theory] with [MemberData]
Implement
GetTestData_For_ToCurrency_ShouldConvertCorrectlyand apply to argument of [MemberData]Expand test cases
public static IEnumerable<object[]> GetTestData_For_ToCurrency_ShouldConvertCorrectly() { yield return new object[] { /* CurrencyInput */, /* Currency */ }; + yield return new object[] + { + /* CurrencyInput */, + /* Currency */ + }; }