Example #1
0
        public void VersionTest()
        {
            //Arrange
            Client myClient = new Client(URL, APIKEY, LANGUAGE);

            myClient.Username = "******";
            myClient.Password = "******";
            idoit   idoit   = new idoit(myClient);
            Version request = new Version();
            Logout  logout  = new Logout();
            Login   login   = new Login();

            //login
            login = idoit.Login();

            //Version
            myClient.sessionId = login.sessionId;
            request            = idoit.Version();

            //Logout
            logout = idoit.Logout();

            //Assert
            Assert.IsNotNull(request.version);
            Assert.IsNotNull(request.type);
            Assert.IsNotNull(request.login.language);
        }
Example #2
0
        public void LoginTest()
        {
            //Arrange
            Client myClient = new Client(URL, APIKEY, LANGUAGE);

            myClient.Username = "******";
            myClient.Password = "******";
            idoit idoit   = new idoit(myClient);
            Login request = new Login();

            //Act
            request = idoit.Login();

            //Assert
            Assert.IsTrue(request.result);
            Assert.IsNotNull(request.userId);
        }
Example #3
0
        public void SearchTest()
        {
            //Arrange
            int    objID;
            Client myClient = new Client(URL, APIKEY, LANGUAGE);

            myClient.Username = "******";
            myClient.Password = "******";
            idoit           idoit   = new idoit(myClient);
            Obj             request = new Obj(myClient);
            List <Search[]> lists   = new List <Search[]>();

            //Act
            request.type       = ObjectType.PRINTER;
            request.title      = "Printer 01";
            request.cmdbStatus = CmdbStatus.DEFECT;
            objID = request.Create();


            //Act:Search
            lists = idoit.Search(request.title);

            //Assert
            foreach (Search[] row in lists)
            {
                foreach (Search element in row)
                {
                    Assert.IsNotNull(element.link);
                    Assert.IsNotNull(element.key);
                    Assert.IsNotNull(element.value);
                }
            }
            //Assert
            Assert.IsNotNull(objID);
            Assert.IsNotNull(request.title);
            Assert.IsNotNull(request.type);
            Assert.IsNotNull(request.cmdbStatus);

            //Act:Delete the Object
            request.Delete(objID);
        }