Esempio n. 1
0
        public void PropertiesRequiredValid()
        {
            var user = EntitiesFactory.GetNewUser();

            bool result = user.ValidatePropertiesRequired();

            result.Should().BeTrue();
        }
Esempio n. 2
0
        public async void GetByIdValid()
        {
            var user = EntitiesFactory.GetNewUser();

            _userRepository.GetById(user.Id).Returns(user);

            var result = await _userService.GetById(user.Id);

            result.Should().NotBeNull();
        }
Esempio n. 3
0
        public async void RemoveValid()
        {
            var user = EntitiesFactory.GetNewUser();

            _userRepository.Save(user).Returns(true);

            bool result = await _userService.Remove(user);

            result.Should().BeTrue();
        }
Esempio n. 4
0
        public async void GetByIdInvalid(string id)
        {
            var user = EntitiesFactory.GetNewUser();

            _userRepository.GetById(id).Returns(user);

            var result = await _userService.GetById(id);

            result.Should().BeNull();
        }
Esempio n. 5
0
        public async void RemoveInvalid(string id)
        {
            var user = EntitiesFactory.GetNewUser();

            user.Id = id;
            _userRepository.Save(user).Returns(true);

            bool result = await _userService.Remove(user);

            result.Should().BeFalse();
        }
Esempio n. 6
0
        public async void GetAllValid()
        {
            var listReturns = new List <User> {
                EntitiesFactory.GetNewUser()
            };

            _userRepository.GetAll().Returns(listReturns);

            IEnumerable <User> result = await _userService.GetAll();

            result.Should().NotBeNull();
        }
Esempio n. 7
0
        public async void GetByConductorClassValid()
        {
            List <User> listReturn = EntitiesFactory.GetUserList();
            var         user       = EntitiesFactory.GetNewUser();

            listReturn.Add(user);
            _userRepository.GetByConductorClass(user.ConductorClass).Returns(listReturn);

            IEnumerable <User> result = await _userService.GetByConductorClass(user.ConductorClass);

            result.Should().NotBeNull();
        }
Esempio n. 8
0
        public async void GetByCompanyIdValid()
        {
            var user        = EntitiesFactory.GetNewUser();
            var listReturns = new List <User> {
                user
            };

            _userRepository.GetByCompanyId(user.CompanyId).Returns(listReturns);

            IEnumerable <User> result = await _userService.GetByCompanyId(user.CompanyId);

            result.Should().NotBeNull();
        }