예제 #1
0
    public void TestGenericSetupReturnsWithTestMethodReturnInstanceObject()
    {
        var originalResult = TestStaticClass.TestMethodReturnReferenceObject();
        var expectedResult = new TestInstance
        {
            IntProperty    = 1,
            ObjectProperty = new object()
        };

        Mock.Setup(
            () => TestStaticClass.TestMethodReturnReferenceObject(),
            () =>
        {
            var actualResult = TestStaticClass.TestMethodReturnReferenceObject();

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