public void ShouldNotRegisterNewClientIfItExists()
        {
            //Arrange
            ClientRegistrationInfo args = new ClientRegistrationInfo();

            args.Name  = "Alex Grind";
            args.Phone = "+3 893 212 11 21";
            //Act
            clientsService.RegisterNew(args);
            clientTableRepository.Contains(Arg.Is <ClientEntity>(
                                               s => s.Name == args.Name &&
                                               s.Phone == args.Phone)).Returns(true);

            //Assert
            clientsService.RegisterNew(args);
        }
        public int RegisterNewClient(ClientRegistrationInfo args)
        {
            var entityToAdd = (new ClientEntity()
            {
                RegistationDateTime = DateTime.Now,
                Name = args.Name,
                Phone = args.Phone,
                Balance = 0M
            });

            if (clientTableRepository.Contains(entityToAdd))
            {
                throw new ArgumentException("This client has been already registered");
            }
            clientTableRepository.Add(entityToAdd);
            clientTableRepository.SaveChanges();
            return(entityToAdd.Id);
        }