0

My scenario is : Test script is requiring data from multiple excel files, so i want to have multiple testcasesource on Test method. Is there a way of having multiple testcasesource.

For below Code my explanation:

Iteration 1: It should fetch "TC01" patientdetails and "TC01" loginDetails and run script.

Iteration 2 : It should fetch "KT"patientdetails and "TC01" loginDetails and run script.

Main Hurdle is : how to create IEnumerable in such a way that it handles above two scenario.

My code :

        [Test]
        [TestCaseSource(typeof(TestDataLogin), "PatientDetails", new object[] { new string[] { "TC01","KT"} })]
        [TestCaseSource(typeof(TestDataLogin), "LoginDetails", new object[] { new string[] { "TC01" } })]
        public void PatientEnrollment(string userDetails, PatientAndDeviceDetails data,LoginDetails loginData)
        {
        }

I will be too grateful if someone can help me find solution for such case.

  • I'm not clear on what you're trying to achieve. Are you trying to mix the PatientDetails and LoginDetails into the one test? If so then perform the logic of combining them within the one TestCaseSource. – Stephen Straton Nov 14 '19 at 04:24
  • Thank you, added PatientDetails and LoginDetails in one testCaseSource – Kalyani Thosar Dec 03 '19 at 10:51

1 Answers1

0

I'm not clear on what you're trying to achieve. Are you trying to mix the PatientDetails and LoginDetails into the one test? If so then perform the logic of combining them within the one TestCaseSource

Stephen Straton
  • 709
  • 5
  • 12