Question: I have multiple test cases and I want to write a common method which can count all fail or pass test case and print the total pass and fail test case at the end of execution.

Answer: 
```
int Failed = 0;
int Passed = 0;
var TestCases = TestSuite.Current.SelectedRunConfig.GetActiveTestContainers();
        foreach(var testcase in TestCases){
        {if(testcase.IsTestCase){ //To Handle Smart Folders
                if(testcase.Status.ToString()=="Failed")
                    {
                    Failed++;
                    }
                Passed++;
            }
            }
        }
        Report.Log(ReportLevel.Info, "Passed Count :"+Passed);
        Report.Log(ReportLevel.Info, "Failed Count :"+Failed);
    }

```
Add 2 global parameters with value 0 (varSuccess, varFail).
Everytime you validate anything depending on the outcome just add to the either value. When test run has finished do what ever you want with those values (eg. write them to the report file, console etc).