コード例 #1
0
    public void GetResultDataType_WithRegularType_ReturnsType()
    {
        // Arrange
        var mapper = new ActionResultTypeMapper();

        var returnType = typeof(string);

        // Act
        var result = mapper.GetResultDataType(returnType);

        // Assert
        Assert.Equal(typeof(string), result);
    }
コード例 #2
0
    public void GetResultDataType_WithActionResultOfT_UnwrapsType()
    {
        // Arrange
        var mapper = new ActionResultTypeMapper();

        var returnType = typeof(ActionResult <string>);

        // Act
        var result = mapper.GetResultDataType(returnType);

        // Assert
        Assert.Equal(typeof(string), result);
    }