private void Execute(EditTableCommand command) { if (!_blockMock) { UnitOfWorkMock.Get <Table>(Arg.Any <int>()).Returns(Edited); UnitOfWorkMock.Add(Arg.Any <Type>(), Arg.Any <Table>()).Returns(Edited); UnitOfWorkMock.Add(Arg.Any <Type>(), Arg.Any <User>()).Returns(EditedUser); } var handler = new EditTableHandler() { UnitOfWork = UnitOfWorkMock }; handler.Handle(command); }