public void ExecuteFunction_Works_FourRefParameter <T, A, B, C, D>(Mock <IServiceForOracle> serviceMock, string function) { var fixture = new Fixture(); var valueA = fixture.Create <A>(); var valueB = fixture.Create <B>(); var valueC = fixture.Create <C>(); var valueD = fixture.Create <D>(); var expectedA = fixture.Create <A>(); var expectedB = fixture.Create <B>(); var expectedC = fixture.Create <C>(); var expectedD = fixture.Create <D>(); var expectedValue = fixture.Create <T>(); serviceMock.Setup(s => s.ExecuteFunction <T>(function, It.IsAny <IParam>(), It.IsAny <IParam>(), It.IsAny <IParam>(), It.IsAny <IParam>())) .Callback((string f, IParam[] p) => SetParamValues(p, expectedA, expectedB, expectedC, expectedD)) .Returns(expectedValue); var actual = FunctionExtensions.ExecuteFunction <T, A, B, C, D>(serviceMock.Object, function, ref valueA, ref valueB, ref valueC, ref valueD); Assert.Equal(expectedA, valueA); Assert.Equal(expectedB, valueB); Assert.Equal(expectedC, valueC); Assert.Equal(expectedD, valueD); Assert.Equal(expectedValue, actual); }
public void ExecuteFunction_Works_OneParameter <T, A>(Mock <IServiceForOracle> serviceMock, string function) { var fixture = new Fixture(); var valueA = fixture.Create <A>(); var expectedValue = fixture.Create <T>(); serviceMock.Setup(s => s.ExecuteFunction <T>(function, It.IsAny <IParam>())) .Returns(expectedValue); var actual = FunctionExtensions.ExecuteFunction <T, A>(serviceMock.Object, function, valueA); Assert.Equal(expectedValue, actual); }