Esempio n. 1
0
        public void Setup()
        {
            WfMatrixAdapter.Instance.ClearAll();
            WfMatrixDefinitionAdapter.Instance.ClearAll();

            _wfMatrixInstance   = BuildWfMatrix();
            _isWfMatrixDefExist = WfMatrixDefinitionAdapterTest.CheckWfMatrixDef(_wfMatrixInstance.Definition.Key);
        }
Esempio n. 2
0
        public void WfMatrixDemensionDefinitionSerilizationTest()
        {
            WfConverterHelper.RegisterConverters();
            JSONSerializerExecute.RegisterConverter(typeof(WfMatrixDefinitionConverter));
            JSONSerializerExecute.RegisterConverter(typeof(WfMatrixDefinitionConverter));
            var    matrixDef             = WfMatrixDefinitionAdapterTest.BuildNewMatrixDef(_matrixColumnNum);
            string strSerializeMatrixDef = JSONSerializerExecute.Serialize(matrixDef);

            var matrixDef2 = JSONSerializerExecute.Deserialize <WfMatrixDefinition>(strSerializeMatrixDef);

            string strReserializeMatrixDef = JSONSerializerExecute.Serialize(matrixDef2);

            Console.WriteLine(strSerializeMatrixDef);
            Console.WriteLine(strReserializeMatrixDef);
            Assert.AreEqual(strSerializeMatrixDef, strReserializeMatrixDef);
        }
Esempio n. 3
0
        public WfMatrix BuildWfMatrix()
        {
            var matrixDef = WfMatrixDefinitionAdapterTest.BuildNewMatrixDef(_matrixColumnNum);

            WfMatrix matrixInstance = new WfMatrix(matrixDef)
            {
                CreatorID   = "testCreatorID1",
                CreatorName = "testCreatorName1",
                MatrixID    = UuidHelper.NewUuidString(),
                ProcessKey  = "testProcessKey",
                ActivityKey = "testActivityKey"
            };

            for (int i = 0; i < _matrixRowNum; i++)
            {
                var row = new WfMatrixRow()
                {
                    RowNumber    = i,
                    OperatorType = WfMatrixOperatorType.Person,
                    Operator     = "wanhw"
                };

                if (i % 2 == 0)
                {
                    row.Operator = "fanhy";
                }

                for (int j = 0; j < matrixDef.Dimensions.Count; j++)
                {
                    row.Cells.Add(new WfMatrixCell(matrixDef.Dimensions[j])
                    {
                        StringValue = "String" + j.ToString()
                    });
                }
                matrixInstance.Rows.Add(row);
            }

            return(matrixInstance);
        }