Пример #1
0
        public void GetUserTest()
        {
            var controller = new UserManagementController();

            controller.Request       = new HttpRequestMessage();
            controller.Configuration = new HttpConfiguration();

            var response = controller.Get(1);

            Assert.AreEqual(response.UserID, 1);
            Assert.AreEqual("Riyaz", response.FirstName);
        }
Пример #2
0
        public void GetAllUsersTest()
        {
            var controller = new UserManagementController();

            controller.Request       = new HttpRequestMessage();
            controller.Configuration = new HttpConfiguration();

            var response = controller.Get();



            Assert.IsNotEmpty(response);
        }
Пример #3
0
        public void UpdateUserTest()
        {
            var controller = new UserManagementController();

            controller.Request       = new HttpRequestMessage();
            controller.Configuration = new HttpConfiguration();

            var user = controller.Get(1);

            user.EmployeeID = 456789;

            string result = controller.Put(user);

            Assert.AreEqual("Record updated Successfully", result);
        }