Esempio n. 1
0
        //public long InsertXml(Location location, XmlDocument contents, string callbackURL)
        //{
        //    ITestResultSerializerFactory f = AIR.Common.ServiceLocator.Resolve<ITestResultSerializerFactory>();
        //    if(f == null)
        //        throw new ApplicationException("Cannot insert XML.  Must register a ITestResultSerializerFactory with the ServiceLocator.");
        //    return InsertXml(location, contents, callbackURL, f);
        //}

        public long InsertXml(Location location, XmlDocument contents, string callbackURL, ITestResultSerializerFactory serializerFactory)
        {
            string   testName = null;
            long     testeeKey, oppId;
            bool     isDemo = false;
            DateTime statusDate;

            if (serializerFactory == null)
            {
                throw new ApplicationException("Cannot insert XML.  ITestResultSerializerFactory cannot be null.");
            }
            XMLAdapter adapter = serializerFactory.CreateDeserializer(contents);

            adapter.GetKeyValues(out testName, out oppId, out testeeKey, out statusDate, out isDemo);

            return(InsertXml(location, testName, oppId.ToString(), testeeKey, statusDate, isDemo, contents, callbackURL));
        }