Exemple #1
0
        async void ExecRequires_NotNullInput()
        {
            var transformerMock = new Mock <ILazy <ITransformationManager> >();
            var handler         = new IntegerInputOnlyHandler(transformerMock.Object);
            var exception       =
                await Assert.ThrowsAsync <ArgumentNullException>(() =>
                                                                 handler.ExecAsync((string)null));

            Assert.Equal("input", exception.ParamName);
        }
Exemple #2
0
        async void ExecFrom_WhenInputIsCorrectlyTransformed_ExecActionIsTriggered()
        {
            var transformerMock = new Mock <ILazy <ITransformationManager> >();

            transformerMock.Setup(s => s.Value.Transform <string, Int64?>(It.IsAny <string>()))
            .Returns(0);

            var handler   = new IntegerInputOnlyHandler(transformerMock.Object);
            var exception =
                await Assert.ThrowsAsync <NotImplementedException>(() => handler.ExecAsync(""));

            Assert.Equal("Integer passou por aqui!", exception.Message);
        }