Ejemplo n.º 1
0
        public void FromResponseDataTest()
        {
            var departmentRequest = new DepartmentRequest
            {
                Id                   = 2,
                DisplayOrder         = 2,
                Module               = DepartmentModule.LiveChat,
                ParentDepartmentId   = 2,
                Title                = "Title",
                Type                 = DepartmentType.Private,
                UserGroups           = new List <int>(),
                UserVisibilityCustom = false
            };

            var department = new Department
            {
                Id                   = 2,
                DisplayOrder         = 2,
                Module               = DepartmentModule.LiveChat,
                ParentDepartmentId   = 2,
                Title                = "Title",
                Type                 = DepartmentType.Private,
                UserGroups           = new List <int>(),
                UserVisibilityCustom = false
            };

            var departmentRequestResult = DepartmentRequest.FromResponseData(department);

            AssertUtility.ObjectsEqual(departmentRequest, departmentRequestResult);
        }
Ejemplo n.º 2
0
        public void CreateUpdateDeleteDepartment()
        {
            Department dummyData = TestData;

            Department createdDept = TestSetup.KayakoApiService.Departments.CreateDepartment(DepartmentRequest.FromResponseData(dummyData));

            Assert.IsNotNull(createdDept);
            dummyData.Id = createdDept.Id;
            CompareDepartments(dummyData, createdDept);

            dummyData.Title                = "Updated Title";
            dummyData.Type                 = DepartmentType.Private;
            dummyData.DisplayOrder         = 34;
            dummyData.UserVisibilityCustom = false;
            dummyData.UserGroups           = new List <int>();

            Department updatedDept = TestSetup.KayakoApiService.Departments.UpdateDepartment(DepartmentRequest.FromResponseData(dummyData));

            Assert.IsNotNull(updatedDept);
            CompareDepartments(dummyData, updatedDept);

            bool success = TestSetup.KayakoApiService.Departments.DeleteDepartment(updatedDept.Id);

            Assert.IsTrue(success);
        }