C# Moq是一个函数,但don';我无法访问这些参数

C# Moq是一个函数,但don';我无法访问这些参数,c#,moq,C#,Moq,我有一个类,它构造了一个新对象,添加到我正在模拟的对象的内部状态中。。。差不多 public class foo { public bar raz; public foo(bar raz) { this.raz = raz; } public void InsertItem() { raz.Insert(new FooBar());

我有一个类,它构造了一个新对象,添加到我正在模拟的对象的内部状态中。。。差不多

    public class foo
    {
        public bar raz;

        public foo(bar raz)
        {
            this.raz = raz;
        }

        public void InsertItem()
        {
            raz.Insert(new FooBar());
        }
    }
我想模拟raz,但无法理解调用verify raz.Insert的语法,但它不需要匹配传递的参数(因为它是在内部创建的)。我能做什么

var mock = new Mock<bar>();
mock.Setup(mock => mock.Insert(?)).Verifiable();  //This is the line I can't figure out
var test(mock.Object);
test.InsertItem();
mock.VerifyAll(); 
var mock=new mock();
mock.Setup(mock=>mock.Insert(?).Verifiable()//这条线我搞不懂
var测试(模拟对象);
test.InsertItem();
mock.VerifyAll();
使用:

mock.Setup(mock=>mock.Insert(It.IsAny());
使用:

mock.Setup(mock=>mock.Insert(It.IsAny());
mock.Setup(mock => mock.Insert(It.IsAny<FooBar>()));