public int Add(User item)
 {
     _serviceStorage.Add(item);
     SendMessages(MessageCode.Add, new List <User> {
         item
     });
     return(item.Id);
 }
        public void Add_LastNameIsNull_ExceptionThrown()
        {
            var service = new UserServiceStorage(null);

            service.Add(new User
            {
                FirstName   = "Vlad",
                LastName    = null,
                DateOfBirth = DateTime.Now
            });
        }
        public void Add_ValidUser_ValidUserIsAdded()
        {
            var service = new UserServiceStorage(null);

            int id = service.Add(new User
            {
                FirstName   = "Vlad",
                LastName    = "Star",
                DateOfBirth = DateTime.Now
            });

            Assert.AreEqual(0, id);
        }
        public void Add_NullUser_ExceptionThrown()
        {
            var service = new UserServiceStorage(null);

            service.Add(null);
        }