Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In moq setup I am trying to assign the value of one of the argument to a string variable. Although I used callback but still the variable seems to have null value.

What I have tried:

I tried this

Mock<ILunaService> partialMockLunaService = new Mock<ILunaService>(MockBehavior.Strict);
            partialMockLunaService.Setup(x => x.TranslateText(It.IsAny<MachineTranslationProviderEnum>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<string>(), It.IsAny<MachineTranslationOptionsDto>()))
                .Callback<MachineTranslationProviderEnum, int, int, string, MachineTranslationOptionsDto>((a, b, c, d, e) => actualTextForTranslation = d);  
Posted
Updated 28-May-19 6:14am

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900