0

我正在尝试编写单元测试。

[TestInitialize()]
public void MyTestInitialize()
{
    _mocks=new MockRepository();
    MockFactory.Reset();
    _scheduledOrderprovider = new ScheduledOrderProvider();
    _scheduledOrderRepository = MockRepository.GenerateMock<ScheduledOrderRepository>(); 
}

[TestMethod()]
public void GetScheduledOrderMessageStatusIDsTest()
{                
    int NofOrdersPerMessage = 1;
    int[] expected = GetMockScheduledOrderMessageStatusIDs(NofOrdersPerMessage);
    _scheduledOrderRepository.Expect(x => x.GetOrderMessageStatusIDs(1)).Return(expected);
    int[] actual=_scheduledOrderprovider.GetScheduledOrderMessageStatusIDs(NofOrdersPerMessage);
    _scheduledOrderRepository.VerifyAllExpectations();
    Assert.AreEqual(expected[0], actual[0]);
}

它失败并出现以下错误:

表达式不能包含 lambda 表达式 rhinomock

4

0 回答 0