public void ActionResult() { Assert.True(TestString.TryBoxToResult(typeof(ActionResult <string>), out var boxed)); var value = Assert.IsType <ActionResult <string> >(boxed); Assert.Equal(TestString, value.Value); }
public void Either_Either() { Assert.True(TestString.TryBoxToResult(typeof(Either <Unit, Either <Unit, string> >), out var boxed)); var value = Assert.IsType <Either <Unit, Either <Unit, string> > >(boxed); Assert.Equal(TestString, value.Right.Right); }
public void Either_Task_ActionResult() { Assert.True(TestString.TryBoxToResult(typeof(Either <Unit, Task <ActionResult <string> > >), out var boxed)); var value = Assert.IsType <Either <Unit, Task <ActionResult <string> > > >(boxed); Assert.Equal(TestString, value.Right.Result.Value); }
public void Task_Task() { Assert.True(TestString.TryBoxToResult(typeof(Task <Task <string> >), out var boxed)); var value = Assert.IsType <Task <Task <string> > >(boxed); Assert.Equal(TestString, value.Result.Result); }
public void Either_Task_ActionResult_Void_DoesNotBox() { Assert.False(TestString.TryBoxToResult(typeof(Either <Unit, Task <ActionResult> >), out var boxed)); Assert.Equal(TestString, boxed); }
public void Task_Task_Void_DoesNotBox() { Assert.False(TestString.TryBoxToResult(typeof(Task <Task>), out var boxed)); Assert.Equal(TestString, boxed); }
public void ActionResult_List_DoesNotBox() { Assert.False(TestString.TryBoxToResult(typeof(ActionResult <List <string> >), out var boxed)); Assert.Equal(TestString, boxed); }
public void ValueType_Incompatible() { Assert.False(TestString.TryBoxToResult(typeof(int), out var boxed)); Assert.Equal(TestString, boxed); }
public void Either_List_DoesNotBox() { Assert.False(TestString.TryBoxToResult(typeof(Either <Unit, List <string> >), out var boxed)); Assert.Equal(TestString, boxed); }
public void ValueType_Itself() { Assert.True(TestString.TryBoxToResult(typeof(string), out var boxed)); Assert.Equal(TestString, boxed); }
public void Void() { Assert.False(TestString.TryBoxToResult(typeof(void), out var boxed)); Assert.Equal(TestString, boxed); }