Esempio n. 1
0
        public void DeleteUserTest()
        {
            IUserService userService = ServiceProxyFactory.CreateChannel<IUserService>();
            var model = new Bussiness.User.DataContract.UserModelRequest();
            model.UserId = 9;

            BaseResponse response = userService.DeleteUser(model);
            Assert.IsTrue(response.IsSuccess);

        }
Esempio n. 2
0
        public void DeleteUserTest()
        {
            IUserService userService = ServiceProxyFactory.CreateChannel <IUserService>();
            var          model       = new Bussiness.User.DataContract.UserModelRequest();

            model.UserId = 9;

            BaseResponse response = userService.DeleteUser(model);

            Assert.IsTrue(response.IsSuccess);
        }
Esempio n. 3
0
        public void GetUserTest()
        {
            IUserService userService = ServiceProxyFactory.CreateChannel<IUserService>();
            var model = new Bussiness.User.DataContract.UserModelRequest();


            List<UserModelResponse> users = userService.GetAllUsers();
            Assert.IsTrue(users.Count>1);

            UserModelResponse user = userService.GetUser(new UserModelRequest { UserId = 1 });
            Assert.IsNotNull(user);

        }
Esempio n. 4
0
        public void AddUserTest()
        {
            IUserService userService = ServiceProxyFactory.CreateChannel<IUserService>();
            var model = new Bussiness.User.DataContract.UserModelRequest();
            model.UserName = "******";
            UserModelResponse response = userService.AddUser(model);
            Assert.IsTrue(response.IsSuccess);

            //Ctrip.SOA.Service.Test.UserService.UserServiceClient client = new Service.Test.UserService.UserServiceClient();
            //var model = new Bussiness.User.DataContract.UserModelRequest();
            //model.UserName = "******";
            //UserModelResponse response = client.AddUser(model);
            //Assert.IsTrue(response.IsSuccess);
        }
Esempio n. 5
0
        public void GetUserTest()
        {
            IUserService userService = ServiceProxyFactory.CreateChannel <IUserService>();
            var          model       = new Bussiness.User.DataContract.UserModelRequest();


            List <UserModelResponse> users = userService.GetAllUsers();

            Assert.IsTrue(users.Count > 1);

            UserModelResponse user = userService.GetUser(new UserModelRequest {
                UserId = 1
            });

            Assert.IsNotNull(user);
        }
Esempio n. 6
0
 public void UpdateUserTest()
 {
     try
     {
         IUserService userService = ServiceProxyFactory.CreateChannel <IUserService>();
         var          model       = new Bussiness.User.DataContract.UserModelRequest();
         model.UserId   = 8;
         model.UserName = "******";
         BaseResponse response = userService.UpdateUser(model);
         Assert.IsTrue(response.IsSuccess);
     }
     catch (FaultException ex)
     {
         throw ex;
     }
 }
Esempio n. 7
0
        public void AddUserTest()
        {
            IUserService userService = ServiceProxyFactory.CreateChannel <IUserService>();
            var          model       = new Bussiness.User.DataContract.UserModelRequest();

            model.UserName = "******";
            UserModelResponse response = userService.AddUser(model);

            Assert.IsTrue(response.IsSuccess);

            //Ctrip.SOA.Service.Test.UserService.UserServiceClient client = new Service.Test.UserService.UserServiceClient();
            //var model = new Bussiness.User.DataContract.UserModelRequest();
            //model.UserName = "******";
            //UserModelResponse response = client.AddUser(model);
            //Assert.IsTrue(response.IsSuccess);
        }
Esempio n. 8
0
        public void UpdateUserTest()
        {
            try
            {
                IUserService userService = ServiceProxyFactory.CreateChannel<IUserService>();
                var model = new Bussiness.User.DataContract.UserModelRequest();
                model.UserId = 8;
                model.UserName = "******";
                BaseResponse response = userService.UpdateUser(model);
                Assert.IsTrue(response.IsSuccess);
            }
            catch (FaultException ex)
            {
                throw ex;
            }

        }