public IUnitTestElement DeserializeElement(XmlElement parent, IUnitTestElement parentElement)
        {
            var typeName = parent.GetAttribute("elementType");

            if (Equals(typeName, "ContextElement"))
            {
                return(ContextElement.ReadFromXml(parent,
                                                  _solution,
                                                  _contextFactory));
            }
            if (Equals(typeName, "BehaviorElement"))
            {
                return(BehaviorElement.ReadFromXml(parent,
                                                   parentElement,
                                                   _solution,
                                                   _behaviorFactory));
            }
            if (Equals(typeName, "BehaviorSpecificationElement"))
            {
                return(BehaviorSpecificationElement.ReadFromXml(parent,
                                                                parentElement,
                                                                _solution,
                                                                _behaviorSpecificationFactory));
            }
            if (Equals(typeName, "ContextSpecificationElement"))
            {
                return(ContextSpecificationElement.ReadFromXml(parent,
                                                               parentElement,
                                                               _solution,
                                                               _contextSpecificationFactory));
            }

            return(null);
        }
Esempio n. 2
0
        public IUnitTestElement DeserializeElement(XmlElement parent, IUnitTestElement parentElement)
        {
            var typeName = parent.GetAttribute("elementType");

            if (Equals(typeName, "ContextElement"))
            {
                return(ContextElement.ReadFromXml(parent,
                                                  parentElement,
                                                  _provider,
                                                  _solution,
                                                  _manager,
                                                  _psiModuleManager,
                                                  _cacheManager));
            }
            if (Equals(typeName, "BehaviorElement"))
            {
                return(BehaviorElement.ReadFromXml(parent,
                                                   parentElement,
                                                   _provider,
                                                   _solution,
                                                   _manager,
                                                   _psiModuleManager,
                                                   _cacheManager));
            }
            if (Equals(typeName, "BehaviorSpecificationElement"))
            {
                return(BehaviorSpecificationElement.ReadFromXml(parent,
                                                                parentElement,
                                                                _provider,
                                                                _solution,
                                                                _manager,
                                                                _psiModuleManager,
                                                                _cacheManager));
            }
            if (Equals(typeName, "ContextSpecificationElement"))
            {
                return(ContextSpecificationElement.ReadFromXml(parent,
                                                               parentElement,
                                                               _provider,
                                                               _solution,
                                                               _manager,
                                                               _psiModuleManager,
                                                               _cacheManager));
            }

            return(null);
        }