Hi,
Assuming an IMouvement Object which contains some subobjects like ITache, IStockPalette.
public interface IMouvement : IObjectBase<Guid>
{
ITache Tache { get; set; }
IStockPalette StockPalOrigine { get; set; }
}
How can I Mock this using Rhino Mocks ?
Assuming this test, what's wrong with this ?
[TestMethod]
public void Can_Validate_EmplacementTransitoireRule()
{
var mocks = new MockRepository();
var mouvement = mocks.StrictMock<IMouvement>();
var manager = mocks.StrictMock<ValidationManager>();
mouvement.Tache = mocks.StrictMock<ITache>();
mouvement.StockPalOrigine = mocks.StrictMock<IStockPalette>();
mouvement.ID = Guid.NewGuid();
var rule = new EmplacementTransitoireRule(mouvement);
manager.AddRule(rule);
Expect.Call(manager.ValidateAll()).Return(true);
mocks.ReplayAll();
var all = manager.ValidateAll();
mocks.VerifyAll();
Assert.IsTrue(all);
}
this Test always fails ..