Exemplo n.º 1
0
        private void GenerateSoapConfigFile(string _ConfigFile)
        {
            var defect = new TtDefect(this.connector, 114329);

            defect.SaveTTItemSoapConfig(_ConfigFile);
            Console.WriteLine("Created config file: " + _ConfigFile);
        }
        public void CorrectlyCreatesConfigurationFromFile()
        {
            var connectionMock = new Mock<IIssueManagementConnection>();
            var defect = new TtDefect("user", "version", "summary", "comment", Path.Combine(executionPath, "TesttrackSetup.cfg"), true);
            Assert.That(defect.GetDefect().type, Is.EqualTo("Incorrect functionality"));
            Assert.That(defect.GetDefect().product, Is.EqualTo("Product Data"));
            Assert.That(defect.GetDefect().severity, Is.EqualTo("Automated Testing"));
            Assert.That(defect.GetDefect().state, Is.EqualTo("Open"));
            Assert.That(defect.GetDefect().disposition, Is.EqualTo("Team"));
            Assert.That(defect.GetDefect().customFieldList.Length, Is.EqualTo(3));

            Assert.That((defect.GetDefect().customFieldList[0] as CStringField).name, Is.EqualTo("CustomStringFied"));
            Assert.That((defect.GetDefect().customFieldList[0] as CStringField).value, Is.EqualTo(string.Empty));

            Assert.That((defect.GetDefect().customFieldList[1] as CIntegerField).name, Is.EqualTo("CustomIntFied"));
            Assert.That((defect.GetDefect().customFieldList[1] as CIntegerField).value, Is.EqualTo(1));

            Assert.That((defect.GetDefect().customFieldList[2] as CDropdownField).name, Is.EqualTo("Defective since v."));
            Assert.That((defect.GetDefect().customFieldList[2] as CDropdownField).value, Is.EqualTo("Work"));
        }
Exemplo n.º 3
0
        public long CreateDefect(string summary, string comments)
        {
            this.RefreshConnection(false);

            if (this.connector.IsConnected)
            {
                try
                {
                    var def = new TtDefect(this.userNameForCreation, this.foundInVersion, summary, comments);
                    this.connector.EnableFormattedTextSupport();
                    return(this.connector.CreateDefect(def.GetDefect()));
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                    this.RefreshConnection(true);
                    this.connector.EnableFormattedTextSupport();
                    var def = new TtDefect(this.userNameForCreation, this.foundInVersion, summary, comments);
                    return(this.connector.CreateDefect(def.GetDefect()));
                }
            }

            return(-1);
        }
 private void GenerateSoapConfigFile(string _ConfigFile)
 {
     var defect = new TtDefect(this.connector, 114329);
     defect.SaveTTItemSoapConfig(_ConfigFile);
     Console.WriteLine("Created config file: " + _ConfigFile);
 }
        public long CreateDefect(string summary, string comments)
        {
            this.RefreshConnection(false);

            if (this.connector.IsConnected)
            {
                try
                {
                    var def = new TtDefect(this.userNameForCreation, this.foundInVersion, summary, comments);
                    this.connector.EnableFormattedTextSupport();
                    return this.connector.CreateDefect(def.GetDefect());
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                    this.RefreshConnection(true);
                    this.connector.EnableFormattedTextSupport();
                    var def = new TtDefect(this.userNameForCreation, this.foundInVersion, summary, comments);
                    return this.connector.CreateDefect(def.GetDefect());
                }
            }

            return -1;
        }