C# - The SpiraTestConfiguration "Named Parameters" options throw errors for nullable keywords.

Wednesday, July 23, 2014
Avatar
Hi all,

Using a SpiraTestConfiguration with all of the parameters, e.g.,
SpiraTestConfiguration("https://fakeurl.spiraservice.net", "FakeUserAccount", "FakeUserPassword", TestDataVerification.ProjectId, TestDataVerification.ReleaseNumber, TestDataVerification.TestSetId)
I am able to successfully report results to the server. When I attempt to provide named parameters, e.g.
 SpiraTestConfiguration(
            Url = "https://HeyURLHERE.spiraservice.net",
            Login = "MyAutomationAccount", // Not actual username
            Password = "MyAutomationPassword", // Not actual password
            ProjectId = TestDataVerification.ProjectId, // public const int ProjectId
            TestSetId = TestDataVerification.TestSetId // public const int TestSetId
            // ^^ Error here: 'TestSetId' is not a valid named attribute argument because it is not a valid attribute parameter type   
               )
I'm greeted by a compile time error, "'TestSetId' is not a valid named attribute argument because it is not a valid attribute parameter type". It is listed as a parameter type, so am I wrong in assuming that I should be able to provide an assignment to it?

Any help is welcome, it's very appreciated. Thank you.
9 Replies
Friday, July 25, 2014
Avatar
re: baldwindc Wednesday, July 23, 2014

Hi Daniel

I think the issue is that the expected parameters are camelCase not PascalCase, i.e. use testSetId = XXX instead of TestSetId = XXXX

 SpiraTestConfiguration(
            url = "https://HeyURLHERE.spiraservice.net",
            login = "MyAutomationAccount", // Not actual username
            password = "MyAutomationPassword", // Not actual password
            projectId = TestDataVerification.ProjectId, // public const int ProjectId
            testSetId = TestDataVerification.TestSetId // public const int TestSetId  
               )

Regards

Adam

Monday, July 28, 2014
Avatar
re: inflectra.david Friday, July 25, 2014
Hey Adam, thanks for the response.

Unfortunately using camelCase produces a different error, "...SpiratestConfigurationAttribute does not contain a definition for testSetId"

All of the other named parameters are in PascalCase. I believe the issue has to do with TestSetId being a nullable type (int?) instead of just an int.
Friday, December 12, 2014
Avatar
re: inflectra.david Friday, July 25, 2014
Hi Adam,

Is Spira Configuration support function parameter, because right now i am not able to run my spira test with function parameter in c#

my code is :

  [Test, SpiraTestCase(418)]
       [TestCaseSource(typeof(AdminModel), "UserValidation")]
          public void PublicAdminSpira(string userName, string password) 
          {
              var page = this.OpenPage<LoginPage>(this.AdminModel.LoginPagePath);
              page.Maximize();
              page.FillInForm(userName, password, false);
              page.Login();
              page.Logout();
            

          }

 i have pass two parameter value and run through nunit, than its not shows passed /failed status in spira test ID.

now if i am not user parameter and run through nunit than it shows status with spira test id as passed/failed for example-
 [Test, SpiraTestCase(418)]
    
          public void PublicAdminSpira() 
          {
              var page = this.OpenPage<LoginPage>(this.AdminModel.LoginPagePath);
              page.Maximize();
              page.FillInForm("username", "passwored", false);
              page.Login();
              page.Logout();
            

          }

please replay...
Thanks
Gangotri


Friday, December 12, 2014
Avatar
inflectra.jimx
re: baldwindc Monday, July 28, 2014
Hi Daniel

Yes that could be the case.

Regards
Jim
Friday, December 12, 2014
Avatar
inflectra.jimx
re: gangotri Friday, December 12, 2014
Hi Gangotri

Could you please log this as a new thread.

Regards
Jim
Tuesday, December 16, 2014
Avatar
re: inflectra.jimx Friday, December 12, 2014
Hi Jim,

I have already logged new thread for the same, please replay as soon as possible, because i have to use this in my current automation.

Thanks
Gangotri Sikheria
Tuesday, December 16, 2014
Avatar
re: gangotri Tuesday, December 16, 2014
Hi Jim,

I have also logged tared as well as new  help desk ticket ticket id is: TK17176


Thanks
Gangotri
Tuesday, December 16, 2014
Avatar
re: gangotri Tuesday, December 16, 2014
Hi Gangotri,

Jim already replied a few days ago. See

Regards,
Elise
Tuesday, December 16, 2014
Avatar
re: inflectra.kat Tuesday, December 16, 2014
Hi Gangotri

We have checked and our Add-In does not support such parameterized tests.

Since NUnit 3.0 (in alpha) is getting rid of the entire plugin system we are looking at ways to replace our current add-in once NUnit 3.0 has been released, so no changes are planned to the current add-in at this time.

Regards

Adam

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Wednesday, July 23, 2014
  • Last Reply: Tuesday, December 16, 2014
  • Replies: 9
  • Views: 3530