Exemplo n.º 1
0
        public void WfActivityMatrixResourceSerializationTest()
        {
            IWfProcessDescriptor processDesp = WfProcessTestCommon.GetDynamicProcessDesp();

            XElementFormatter formatter = new XElementFormatter();

            XElement             rootProc          = formatter.Serialize(processDesp);
            IWfProcessDescriptor clonedProcessDesp = (IWfProcessDescriptor)formatter.Deserialize(rootProc);

            IWfActivityDescriptor normalActDesp       = processDesp.Activities["NormalActivity"];
            IWfActivityDescriptor clonedNormalActDesp = clonedProcessDesp.Activities["NormalActivity"];

            Assert.IsNotNull(normalActDesp);
            Assert.IsNotNull(clonedNormalActDesp);

            WfActivityMatrixResourceDescriptor matrixResource       = (WfActivityMatrixResourceDescriptor)normalActDesp.Resources[0];
            WfActivityMatrixResourceDescriptor clonedMatrixResource = (WfActivityMatrixResourceDescriptor)clonedNormalActDesp.Resources[0];

            Assert.AreEqual(matrixResource.PropertyDefinitions.Count, clonedMatrixResource.PropertyDefinitions.Count);
            Assert.AreEqual(matrixResource.Rows.Count, clonedMatrixResource.Rows.Count);
        }