Ejemplo n.º 1
0
        public void FillIfEmpty()
        {
            if (_users.GetUsers().Count == 0)
            {
                FillUsers();
            }

            if (_orders.GetAllOrders().Count == 0)
            {
                FillOrders(_users.GetUser(1, true));
                FillOrders2(_users.GetUser(2, true));
            }
        }
Ejemplo n.º 2
0
        public ActionResult <IEnumerable <User> > GetAll()
        {
            var users = _userDirectory.GetUsers();

            if (users != null)
            {
                return(new ActionResult <IEnumerable <User> >(users));
            }
            else
            {
                return(new NotFoundResult());
            }
        }
        public void PostUser()
        {
            //Arrange
            var    login    = "******";
            string password = "******";

            //Act
            var responce = UserController.Post(new User()
            {
                Login = login, Password = password
            });

            //Assert
            var user = _directoryService.GetUsers().Single();

            Assert.IsTrue(user.Login == login);
            Assert.IsTrue(user.Password == password);
        }