Skip to content

expand unit test for Lib9c.GraphQL.Extensions.CurrencyInputExtensions #506

@boscohyun

Description

@boscohyun

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 */
+   };
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No Assignee

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions