Beispiel #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);

        }
Beispiel #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);
        }
Beispiel #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);

        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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;
     }
 }
Beispiel #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);
        }
Beispiel #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;
            }

        }