public void SaveWareGroupShouldWork()
        {
            var repository = new Mock<IDao<WareGroup>>();
            var entityValidator = new Mock<IEntityValidator>();
            var entityFactory = new Mock<IEntityFactory>();
            var wareGroup = new WareGroup();

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

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

            albumManagerModel.SaveWareGroup(wareGroup);

            entityValidator.Verify(ev => ev.IsValid(wareGroup));
            repository.Verify(rep => rep.Save(wareGroup));
        }
        public void SaveWareGroupShouldDoesntWorkIfWareGroupInvalid()
        {
            var repository = new Mock<IDao<WareGroup>>();
            var entityValidator = new Mock<IEntityValidator>();
            var entityFactory = new Mock<IEntityFactory>();

            var wareGroup = new WareGroup();

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

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

            albumManagerModel.SaveWareGroup(wareGroup);

            entityValidator.Verify(ev => ev.IsValid(wareGroup));
        }