예제 #1
0
        public void StoreActivityLibraryDependencyListBADdependencyActivityLibrary()
        {
            CWF.DataContracts.StoreActivityLibrariesDependenciesDC request = new CWF.DataContracts.StoreActivityLibrariesDependenciesDC();
            CWF.DataContracts.StoreDependenciesRootActiveLibrary rdl = new CWF.DataContracts.StoreDependenciesRootActiveLibrary();
            CWF.DataContracts.StoreActivityLibrariesDependenciesDC reply = null;
            List<CWF.DataContracts.StoreDependenciesDependentActiveLibrary> dalList = new List<CWF.DataContracts.StoreDependenciesDependentActiveLibrary>();

            request.InsertedByUserAlias = INSERTEDBYUSERALIAS;
            request.UpdatedByUserAlias = UPDATEDBYUSERALIAS;
            request.Incaller = INCALLER;
            request.IncallerVersion = INCALLERVERSION;
            rdl.ActivityLibraryName = "TEST#200";
            rdl.ActivityLibraryVersionNumber = "1.0.0.4";

            request.StoreDependenciesRootActiveLibrary = rdl;
            request.StoreDependenciesDependentActiveLibraryList = dalList;

            try
            {
                reply = CWF.BAL.Services.StoreActivityLibraryDependencyList(request);
            }
            catch (Exception ex)
            {
                string faultMessage = ex.Message;
                Assert.Fail(faultMessage + "-catch (Exception ex) on reply = CWF.BAL.StoreActivityLibraryDependencies.StoreActivityLibraryDependencyList(request);");
            }

            Assert.IsNull(reply);
        }
        /// <summary>
        /// Verify CreateActivityLibrariesDependencyList FROM mtblActivityLibraryDependencies Table..
        /// </summary>
        /// <param name="activitiyLibraryName">activitiyLibraryName to do a create or update on.</param>
        /// <param name="version">version to do a create or update on.</param>
        /// <param name="activityLibraryDependentName">activityLibraryDependentName to do a create or update on.</param>
        /// <returns>returns the id created</returns>
        private int CreateActivityLibrariesDependencyList(int activitiyLibraryId, string activitiyLibraryName, string version, 
            int activityLibraryDependentId, string activityLibraryDependentName, string versionDependent)
        {
            createOrUpdateReply = null;

            //Populate the request data
            createOrUpdateRequest = new StoreActivityLibrariesDependenciesDC();
            createOrUpdateRequest.Incaller = IN_CALLER;
            createOrUpdateRequest.UpdatedByUserAlias = USER;
            createOrUpdateRequest.InsertedByUserAlias = USER;
            createOrUpdateRequest.IncallerVersion = IN_CALLER_VERSION;

            var storeDependenciesActivityLib = new StoreDependenciesRootActiveLibrary();
            storeDependenciesActivityLib.ActivityLibraryId = activitiyLibraryId;
            storeDependenciesActivityLib.ActivityLibraryName = activitiyLibraryName;
            storeDependenciesActivityLib.ActivityLibraryVersionNumber = version;

            //Set Request StoreDependenciesRootActiveLibrary object
            createOrUpdateRequest.StoreDependenciesRootActiveLibrary = storeDependenciesActivityLib;

            var storeDependenciesDependentActiveLibraryList = new List<StoreDependenciesDependentActiveLibrary>();
            StoreDependenciesDependentActiveLibrary storeDependenciesDependentActiveLibrary = new StoreDependenciesDependentActiveLibrary();
            storeDependenciesDependentActiveLibrary.ActivityLibraryDependentId = activityLibraryDependentId;
            storeDependenciesDependentActiveLibrary.ActivityLibraryDependentName = activityLibraryDependentName;
            storeDependenciesDependentActiveLibrary.ActivityLibraryDependentVersionNumber = versionDependent;
            storeDependenciesDependentActiveLibraryList.Add(storeDependenciesDependentActiveLibrary);

            //set StoreDependenciesDependentActiveLibraryList object
            createOrUpdateRequest.StoreDependenciesDependentActiveLibraryList = storeDependenciesDependentActiveLibraryList;

            try
            {
                createOrUpdateReply = devBranchProxy.StoreActivityLibraryDependencyList(createOrUpdateRequest);
            }
            catch (FaultException e)
            {
                Assert.Fail("Failed to createOrUpdate data from mtblActivityLibraryDependencies: {0}", e.Message);
            }
            catch (Exception ex)
            {
                Assert.Fail("Failed to createOrUpdate data from mtblActivityLibraryDependencies: {0}", ex.Message);
            }

            Assert.IsNotNull(createOrUpdateReply, "StoreActivityLibrariesDependenciesDC object null");
            Assert.IsNotNull(createOrUpdateReply.StatusReply, "createOrUpdateReply.StatusReply is null");
            Assert.AreEqual(0, createOrUpdateReply.StatusReply.Errorcode, "createOrUpdateReply.StatusReply.Errorcode is not 0. Instead it is {0}.", createOrUpdateReply.StatusReply.Errorcode);

            int activityLibraryId = VerifyGetActivityLibraryDependencies(activitiyLibraryName, version, false);
            Assert.IsNotNull(getReplyList, "getReplyList is null.");
            Assert.AreNotEqual(0, getReplyList.Count, " getReply.List.Count is 0.");

            return activityLibraryId;
        }
예제 #3
0
        public void BALActivityLibraryDependenciesTreeGet()
        {
            var request = new CWF.DataContracts.StoreActivityLibrariesDependenciesDC();
            var rdl = new CWF.DataContracts.StoreDependenciesRootActiveLibrary();
            List<CWF.DataContracts.StoreActivityLibrariesDependenciesDC> reply = null;

            request.Incaller = INCALLER;
            request.IncallerVersion = INCALLERVERSION;
            rdl.ActivityLibraryName = "OASP.Core";
            rdl.ActivityLibraryVersionNumber = "2.2.108.0";
            request.StoreDependenciesRootActiveLibrary = rdl;

            //// TreeGet
            try
            {
                reply = ActivityLibraryDependencyBusinessService.GetActivityLibraryDependencyTree(request);
            }
            catch (Exception ex)
            {
                string faultMessage = ex.Message;
                Assert.Fail(faultMessage + "-catch (Exception ex) in reply = CWF.DAL.Activities.StoreActivityLibraryDependenciesTreeGet(request, treeGet)");
            }

            Assert.IsNotNull(reply);
            Assert.AreEqual(SprocValues.REPLY_ERRORCODE_VALUE_OK, reply[0].StatusReply.Errorcode);
        }