public void Should_Call_Persister_Save_Method_When_Creating_Objects() { _persister.Expect(a => a.Save(Arg <object> .Is.Anything)).Return(true); _factory.Define(() => new House { Color = "blue", SquareFoot = 50 }); _factory.Create <House>(); _persister.VerifyAllExpectations(); }
private void CreatePersister() { mocks.Record(); persister = mocks.DynamicMock <IPersister>(); repository = new FakeContentItemRepository(); persister.Expect(p => p.Repository).Return(repository); persister.ItemMoving += null; moving = LastCall.IgnoreArguments().Repeat.Any().GetEventRaiser(); persister.ItemCopying += null; copying = LastCall.IgnoreArguments().Repeat.Any().GetEventRaiser(); persister.ItemDeleting += null; deleting = LastCall.IgnoreArguments().Repeat.Any().GetEventRaiser(); persister.ItemSaving += null; saving = LastCall.IgnoreArguments().Repeat.Any().GetEventRaiser(); mocks.Replay(persister); }