在我的單元測試中,我需要改變之前被嘲笑的對象的值。例如: public class Cell
{
public int X { get; set; }
public int Y { get; set; }
public string Value { get; set; }
}
public class Table
{
private Cell[,]
我有一個方法的接口上的值: SomeClass的DoSomething的(SomeClass的任何);` 我不能做.Returns(x => x)因爲錯誤的: cannot convert lambda expression to type Someclass because it is not a delegate type. 任何想法?
你好計算器, 我嘗試寫上預期接口(EnvDTE.Project)的私有方法的單元測試。即時通訊使用起訂量框架來創建此接口的模擬: Mock<Project> mock = new Mock<Project>();
後IM設置一些Propertys,我想施放此模擬的接口後面。 我想這一點: mock.As<Project>(); //to implement the Project in