示例#1
0
        public void SetWorkFlowMappingSameValues()
        {
            m_Utils.CreateAndSetNewContext(ErrorIndexType.SqlExpress, true);
            m_Utils.ActivateContext(0);

            GetStatusMappingsResponse getResp = m_Utils.GetStatusMappings(0, StackHashMappingType.WorkFlow);

            Assert.AreEqual(StackHashMappingType.WorkFlow, getResp.MappingType);
            Assert.AreEqual(16, getResp.StatusMappings.Count);

            SetStatusMappingsResponse setResp = m_Utils.SetStatusMappings(0, StackHashMappingType.WorkFlow, getResp.StatusMappings);

            Assert.AreEqual(StackHashMappingType.WorkFlow, setResp.MappingType);

            GetStatusMappingsResponse getResp2 = m_Utils.GetStatusMappings(0, StackHashMappingType.WorkFlow);

            Assert.AreEqual(StackHashMappingType.WorkFlow, getResp2.MappingType);
            Assert.AreEqual(16, getResp2.StatusMappings.Count);

            foreach (StackHashMapping mapping in getResp.StatusMappings)
            {
                StackHashMapping matchMapping = findMapping(getResp2.StatusMappings, mapping.MappingType, mapping.Id);
                Assert.AreNotEqual(null, matchMapping);

                Assert.AreEqual(mapping.MappingType, matchMapping.MappingType);
                Assert.AreEqual(mapping.Id, matchMapping.Id);
                Assert.AreEqual(mapping.Name, matchMapping.Name);
            }
        }
示例#2
0
        public void SetGroupNotImplemented()
        {
            m_Utils.CreateAndSetNewContext(ErrorIndexType.SqlExpress, true);
            m_Utils.ActivateContext(0);

            GetStatusMappingsResponse resp = m_Utils.GetStatusMappings(0, StackHashMappingType.Group);

            Assert.AreEqual(StackHashMappingType.Group, resp.MappingType);
            Assert.AreEqual(0, resp.StatusMappings.Count);

            StackHashMapping mapping = new StackHashMapping();

            mapping.MappingType = StackHashMappingType.Group;
            mapping.Id          = 0;
            mapping.Name        = "Hello";

            resp.StatusMappings.Add(mapping);
            try
            {
                SetStatusMappingsResponse setResp = m_Utils.SetStatusMappings(0, StackHashMappingType.Group, resp.StatusMappings);
            }
            catch (FaultException <ReceiverFaultDetail> ex)
            {
                Assert.AreEqual(true, ex.Detail.Message.Contains("Groups are not currently implemented"));
                throw;
            }
        }
示例#3
0
        public void SetMappingMixedTypes()
        {
            m_Utils.CreateAndSetNewContext(ErrorIndexType.SqlExpress, true);
            m_Utils.ActivateContext(0);

            GetStatusMappingsResponse resp = m_Utils.GetStatusMappings(0, StackHashMappingType.WorkFlow);

            Assert.AreEqual(StackHashMappingType.WorkFlow, resp.MappingType);
            Assert.AreEqual(16, resp.StatusMappings.Count);

            StackHashMapping mapping = new StackHashMapping();

            mapping.Id          = 12;
            mapping.MappingType = StackHashMappingType.WorkFlow;
            mapping.Name        = "Fred";

            resp.StatusMappings.Add(mapping);

            try
            {
                SetStatusMappingsResponse setResp = m_Utils.SetStatusMappings(0, StackHashMappingType.Group, resp.StatusMappings);
            }
            catch (FaultException <ReceiverFaultDetail> ex)
            {
                Assert.AreEqual(true, ex.Detail.Message.Contains("Mapping types don't match"));
                throw;
            }
        }
示例#4
0
        public void SetWorkFlowMappingTooFew()
        {
            m_Utils.CreateAndSetNewContext(ErrorIndexType.SqlExpress, true);
            m_Utils.ActivateContext(0);

            try
            {
                SetStatusMappingsResponse setResp = m_Utils.SetStatusMappings(0, StackHashMappingType.WorkFlow, new StackHashMappingCollection());
            }
            catch (FaultException <ReceiverFaultDetail> ex)
            {
                Assert.AreEqual(true, ex.Detail.Message.Contains("Unexpected number of workflow mappings"));
                throw;
            }
        }
示例#5
0
        public void SetWorkFlowMappingNullName()
        {
            m_Utils.CreateAndSetNewContext(ErrorIndexType.SqlExpress, true);
            m_Utils.ActivateContext(0);

            GetStatusMappingsResponse resp = m_Utils.GetStatusMappings(0, StackHashMappingType.WorkFlow);

            Assert.AreEqual(StackHashMappingType.WorkFlow, resp.MappingType);
            Assert.AreEqual(16, resp.StatusMappings.Count);

            resp.StatusMappings[1].Name = null;

            try
            {
                SetStatusMappingsResponse setResp = m_Utils.SetStatusMappings(0, StackHashMappingType.WorkFlow, resp.StatusMappings);
            }
            catch (FaultException <ReceiverFaultDetail> ex)
            {
                Assert.AreEqual(true, ex.Detail.Message.Contains("Mapping name of null found"));
                throw;
            }
        }
示例#6
0
        public void SetWorkFlowMappingIdTooSmall()
        {
            m_Utils.CreateAndSetNewContext(ErrorIndexType.SqlExpress, true);
            m_Utils.ActivateContext(0);

            GetStatusMappingsResponse resp = m_Utils.GetStatusMappings(0, StackHashMappingType.WorkFlow);

            Assert.AreEqual(StackHashMappingType.WorkFlow, resp.MappingType);
            Assert.AreEqual(16, resp.StatusMappings.Count);

            resp.StatusMappings[1].Id = -1;

            try
            {
                SetStatusMappingsResponse setResp = m_Utils.SetStatusMappings(0, StackHashMappingType.WorkFlow, resp.StatusMappings);
            }
            catch (FaultException <ReceiverFaultDetail> ex)
            {
                Assert.AreEqual(true, ex.Detail.Message.Contains("Invalid negative workflow id"));
                throw;
            }
        }