Beispiel #1
0
        public void SaveTimeBoundAccessRequestTest()
        {
            ChangeRequestInterface api  = new CRSubSystemAPI();
            TimeBoundAccessRequest tbar = new TimeBoundAccessRequest();

            tbar.Approver          = "nsubugak";
            tbar.ApproverReason    = "PENDING";
            tbar.CreatedBy         = "nsubugak";
            tbar.CreatedOn         = DateTime.Now;
            tbar.DurationInMinutes = 15;
            tbar.ModifiedBy        = "nsubugak";
            tbar.ModifiedOn        = DateTime.Now;
            tbar.Reason            = "To Debug Stuff";
            tbar.StartTime         = DateTime.Now;;
            tbar.Status            = "PENDING";
            tbar.SystemCode        = "DATABASE";
            tbar.TBPAccessId       = DateTime.Now.Ticks.ToString();
            tbar.UserId            = "nsubugak";
            tbar.TypeOfAccess      = "UPDATE";


            ApiResult result = api.SaveTimeBoundAccessRequest(tbar);

            Assert.AreEqual(Globals.SUCCESS_STATUS_TEXT, result.StatusDesc);
        }
Beispiel #2
0
        public void LoginTest_InvalidParameters()
        {
            ChangeRequestInterface api    = new CRSubSystemAPI();
            SystemUser             result = api.Login(null, null);

            Assert.AreEqual(Globals.FAILURE_STATUS_CODE, result.StatusCode);
        }
Beispiel #3
0
        public void SaveChangeRequestTest()
        {
            ChangeRequestInterface api           = new CRSubSystemAPI();
            ChangeRequest          changeRequest = new ChangeRequest();

            changeRequest.ApprovalStatus          = "PENDING";
            changeRequest.ApprovalReason          = "";
            changeRequest.ChangeCategoryId        = "EMERGENCY_CHANGE";
            changeRequest.ChangeRequestId         = DateTime.Now.Ticks.ToString();
            changeRequest.ChangeEndDateTime       = DateTime.Now;
            changeRequest.ChangeStartDateTime     = DateTime.Now;
            changeRequest.ImpactOfNotImplementing = "Bad Stuff";
            changeRequest.ImplementerCompany      = "Pegasus";
            changeRequest.ImplementerEmail        = "*****@*****.**";
            changeRequest.ImplementerName         = "kasozi";
            changeRequest.ImplementerPhone        = "0785975800";
            changeRequest.Justification           = "We need to do this";
            changeRequest.RequesterCompany        = "Stanbic";
            changeRequest.RequesterEmail          = "*****@*****.**";
            changeRequest.RequesterName           = "Damalie";
            changeRequest.RequesterPhone          = "0785975800";
            changeRequest.Title = "Changing Transaction Status";

            ApiResult result = api.SaveChangeRequest(changeRequest);

            Assert.AreEqual(Globals.SUCCESS_STATUS_TEXT, result.StatusDesc);
        }
Beispiel #4
0
        public void ExecuteDataSetTest()
        {
            ChangeRequestInterface api = new CRSubSystemAPI();
            DataTable result           = api.ExecuteDataSet("GetSystemUserById", new object[] { "*****@*****.**" }).Tables[0];

            Assert.IsNotNull(result);
        }
Beispiel #5
0
        public void SendOneTimePINTest_InvalidParameters()
        {
            ChangeRequestInterface api = new CRSubSystemAPI();
            ApiResult result           = api.SendOneTimePIN(null, null);

            Assert.AreEqual(Globals.FAILURE_STATUS_CODE, result.StatusCode);
            Assert.IsNotNull(result.StatusDesc);
        }
Beispiel #6
0
        public void SendOneTimePINTest()
        {
            ChangeRequestInterface api = new CRSubSystemAPI();

            SaveSystemUserTest();
            ApiResult result = api.SendOneTimePIN("*****@*****.**", "PHONE");

            Assert.AreEqual(Globals.SUCCESS_STATUS_TEXT, result.StatusDesc);
        }
Beispiel #7
0
        public void UpdateChangeRequestStatusTest_InvalidParameters()
        {
            ChangeRequestInterface   api           = new CRSubSystemAPI();
            ChangeRequest            changeRequest = new ChangeRequest();
            ApproverForChangeRequest link          = new ApproverForChangeRequest();
            ApiResult result = api.UpdateChangeRequestStatus(link);

            Assert.AreEqual(Globals.FAILURE_STATUS_CODE, result.StatusCode);
        }
Beispiel #8
0
        public void AttachPostChangeTestsToChangeRequestTest()
        {
            ChangeRequestInterface api            = new CRSubSystemAPI();
            PostChangeTest         systemAffected = new PostChangeTest();

            systemAffected.TestDesc = "Test";
            ApiResult result = api.AttachPostChangeTestToChangeRequest(systemAffected);

            Assert.AreEqual(Globals.SUCCESS_STATUS_TEXT, result.StatusDesc);
        }
Beispiel #9
0
 protected void Application_Start(object sender, EventArgs e)
 {
     try
     {
         CRSubSystemAPI.Initialize();
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #10
0
        public void SaveCompanyTest()
        {
            ChangeRequestInterface api = new CRSubSystemAPI();
            Company company            = new Company();

            company.CompanyCode = "PEGASUS";
            company.CompanyName = "Pegasus Technologies Uganda";
            company.ModifiedBy  = "Admin";
            ApiResult result = api.SaveCompany(company);

            Assert.AreEqual(Globals.SUCCESS_STATUS_TEXT, result.StatusDesc);
        }
Beispiel #11
0
        public void AttachItemsToChangeRequestTest()
        {
            ChangeRequestInterface api            = new CRSubSystemAPI();
            CR_Attachment          systemAffected = new CR_Attachment();

            systemAffected.Base64StringOfContent = "Test";
            systemAffected.Name = "Test";
            systemAffected.Hash = "Update";
            ApiResult result = api.AttachItemsToChangeRequest(systemAffected);

            Assert.AreEqual(Globals.SUCCESS_STATUS_TEXT, result.StatusDesc);
        }
Beispiel #12
0
        public void AttachRollBackPlanToChangeRequestTest()
        {
            ChangeRequestInterface api            = new CRSubSystemAPI();
            RollBackPlan           systemAffected = new RollBackPlan();

            systemAffected.ChangeRequestId     = "Test";
            systemAffected.RollBackPlanDetails = "Test";

            ApiResult result = api.AttachRollBackPlanToChangeRequest(systemAffected);

            Assert.AreEqual(Globals.SUCCESS_STATUS_TEXT, result.StatusDesc);
        }
Beispiel #13
0
        public void AssignChangeRequestToApproverTest()
        {
            ChangeRequestInterface   api  = new CRSubSystemAPI();
            ApproverForChangeRequest link = new ApproverForChangeRequest();

            link.ChangeRequestId = "1234";
            link.Decision        = "";
            link.Reason          = "";
            link.ApproverId      = "*****@*****.**";
            ApiResult result = api.AssignChangeRequestToApprover(link);

            Assert.AreEqual(Globals.SUCCESS_STATUS_TEXT, result.StatusDesc);
        }
Beispiel #14
0
        public void SaveRoleTest()
        {
            ChangeRequestInterface api = new CRSubSystemAPI();
            Role newRole = new Role();

            newRole.CompanyCode = "PEGASUS";
            newRole.RoleName    = "Pegasus Team Lead";
            newRole.RoleCode    = "REVIEWER";
            newRole.ModifiedBy  = "Admin";
            ApiResult result = api.SaveRole(newRole);

            Assert.AreEqual(Globals.SUCCESS_STATUS_TEXT, result.StatusDesc);
        }
Beispiel #15
0
        public void AttachSystemsAffectedToChangeRequestTest()
        {
            ChangeRequestInterface api            = new CRSubSystemAPI();
            SystemAffected         systemAffected = new SystemAffected();

            systemAffected.SystemName   = "Test";
            systemAffected.SystemType   = "Test";
            systemAffected.TypeOfChange = "Update";
            systemAffected.Details      = "Test";
            ApiResult result = api.AttachSystemsAffectedToChangeRequest(systemAffected);

            Assert.AreEqual(Globals.SUCCESS_STATUS_TEXT, result.StatusDesc);
        }
Beispiel #16
0
        public static void Main(string[] args)
        {
            CRSubSystemAPI.Initialize();
            ChangeRequestInterface   api  = new CRSubSystemAPI();
            ApproverForChangeRequest link = new ApproverForChangeRequest
            {
                ChangeRequestId = "12345",
                Decision        = "APPROVED",
                Reason          = "APPROVED",
                ApproverId      = "*****@*****.**"
            };
            ApiResult result = api.UpdateChangeRequestStatus(link);

            Console.Read();
        }
Beispiel #17
0
        public void SaveSystemUserTest()
        {
            ChangeRequestInterface api  = new CRSubSystemAPI();
            SystemUser             user = new SystemUser();

            user.CompanyCode = "PEGASUS";
            user.Username    = "******";
            user.RoleCode    = "SUPER-ADMIN";
            user.ModifiedBy  = "Admin";
            user.PhoneNumber = "256752001311";

            ApiResult result = api.SaveSystemUser(user);

            Assert.AreEqual(Globals.SUCCESS_STATUS_TEXT, result.StatusDesc);
        }
Beispiel #18
0
        public void LoginTest()
        {
            ChangeRequestInterface api = new CRSubSystemAPI();

            SaveSystemUserTest();
            OneTimePassword OTP = new OneTimePassword
            {
                Username = "******",
                Password = "******",
                ValidityDurationInSeconds = 5 * 60 * 1000,
                CompanyCode = "pegasus"
            };

            OTP.Save();
            SystemUser result = api.Login("*****@*****.**", "1234");

            Assert.AreEqual(Globals.SUCCESS_STATUS_TEXT, result.StatusDesc);
        }
Beispiel #19
0
        public void SendApproveCrEmailTest()
        {
            ChangeRequestInterface api = new CRSubSystemAPI();

            ChangeRequest changeRequest = new ChangeRequest();

            changeRequest.ApprovalStatus          = "PENDING";
            changeRequest.ApprovalReason          = "";
            changeRequest.ChangeCategoryId        = "EMERGENCY_CHANGE";
            changeRequest.ChangeRequestId         = DateTime.Now.Ticks.ToString();
            changeRequest.ChangeEndDateTime       = DateTime.Now;
            changeRequest.ChangeStartDateTime     = DateTime.Now;
            changeRequest.ImpactOfNotImplementing = "Bad Stuff";
            changeRequest.ImplementerCompany      = "Pegasus";
            changeRequest.ImplementerEmail        = "*****@*****.**";
            changeRequest.ImplementerName         = "kasozi";
            changeRequest.ImplementerPhone        = "0785975800";
            changeRequest.Justification           = "We need to do this";
            changeRequest.RequesterCompany        = "Stanbic";
            changeRequest.RequesterEmail          = "*****@*****.**";
            changeRequest.RequesterName           = "Damalie";
            changeRequest.RequesterPhone          = "0785975800";
            changeRequest.Title    = "Changing Transaction Status";
            changeRequest.Problem  = "Pegasus server 192.168.55.3 wishes to access UTL airtime listening on URL http://172.25.100.6/atpurchase.php  in order to be able to send Airtime Top Up requests for UTL phone numbers";
            changeRequest.Solution = "Creation of UTL VPN";
            changeRequest.Save();

            ApproverForChangeRequest systemAffected = new ApproverForChangeRequest();

            systemAffected.ChangeRequestId = changeRequest.ChangeRequestId;
            systemAffected.ApproverId      = "nsubugak";
            string    ApproveURL = "";
            ApiResult result     = api.SendApproveCrEmail(systemAffected);

            Assert.AreEqual(Globals.SUCCESS_STATUS_TEXT, result.StatusDesc);
        }
 public AbstractModelTestCase()
 {
     CRSubSystemAPI.DropAndRecreate();
 }