Unit Test odd behavior

This is not really a question, since I can make it work. It's just something I have not seen before and I think it is odd. I'm writing some unit tests. One test works fine, but when I change a parameter for another test, it gives an error. The parameters do match what is passed into the methods. I just didn't retype the test method attribute each time here. This is not my actual code because that is the property of my employer and I am not allowed to post any of it. Hopefully there are no typos due to typing it out instead of copy/paste. This is C#.

Have any of you seen this before, and do you know why it would do this?

[TestMethod]
[DataRow(enumName.SomeValue, "stringValue", new string[] {"aryVal1","aryVal2"})] //this works, but when I remove the string value, it does not

[DataRow(enumName.SomeValue, new string[] {"aryVal1","aryVal2"})] //this gives error CS0182: An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type

[DataRow( new string[] {"aryVal1","aryVal2"}, enumName.SomeValue)] //this works, but all I did was change the order of the parameters

Web-Testing Automation in Python

Python is becoming the most widely used programming language.

Different Types of Testing

  • Unit Test — you can picture this being at the bottom of the pyramid. It is mostly used to pinpoint bugs in your code. It cannot be used for integration testing, unit tests should essentially just give the function that’s tested some inputs, and then check what the function outputs are correct.
  • UI Testing — the user interface testing, on the other hand, it can be pictured at the top of the pyramid. The purpose is to test UI elements and features, to replicate a user experience. Usually, this is the most time consuming and expensive type of testing on your web application.
  • Service/API Layer Testing — the aim is to split UI testing from Unit testing and test functionality in terms of services.

Efficient UI testing

I'm going to go ahead and assume that you know what Selenium is and that you are familiar with "Unit Test" or "Pytest" in python. If you are not, I would suggest that you read an article about either, or try them out yourself!