Beispiel #1
0
    public void TestGenericSetupReturnsWithTestMethodRefParameter()
    {
        var x = 1;
        var originalResult = TestStaticClass.TestMethodReturn1WithRefParameter(ref x);
        var expectedResult = 2;

        Mock.Setup(
            () => TestStaticClass.TestMethodReturn1WithRefParameter(ref x),
            () =>
        {
            var y            = 1;
            var actualResult = TestStaticClass.TestMethodReturn1WithRefParameter(ref y);

            Assert.AreNotEqual(originalResult, actualResult);
            Assert.AreEqual(expectedResult, actualResult);
        })
        .Returns(expectedResult);
    }