public void SaveWorkerShouldDoesntWorkIfWorkerInvalid()
        {
            var repository = new Mock<IDao<Worker>>();
            var entityValidator = new Mock<IEntityValidator>();
            var entityFactory = new Mock<IEntityFactory>();

            var worker = new Worker();

            entityValidator.Setup(ev => ev.IsValid(worker)).Returns(false);

            var albumManagerModel = new CreateWorkerModel(repository.Object,
                                                          entityFactory.Object,
                                                          entityValidator.Object);

            albumManagerModel.SaveWorker(worker);

            entityValidator.Verify(ev => ev.IsValid(worker));
        }
        public void SaveWorkerShouldWork()
        {
            var repository = new Mock<IDao<Worker>>();
            var entityValidator = new Mock<IEntityValidator>();
            var entityFactory = new Mock<IEntityFactory>();
            var worker = new Worker();

            entityValidator.Setup(ev => ev.IsValid(worker)).Returns(true);
            repository.Setup(rep => rep.Save(It.IsAny<Worker>())).AtMostOnce();

            var albumManagerModel = new CreateWorkerModel(repository.Object,
                                                          entityFactory.Object,
                                                          entityValidator.Object);

            albumManagerModel.SaveWorker(worker);

            entityValidator.Verify(ev => ev.IsValid(worker));
            repository.Verify(rep => rep.Save(worker));
        }