I tried searching for this and found several similar things but nothing on point; admittedly I could have been searching using wrong terms.
I have a large automation project that is being worked on by several different dev teams who don't communicate changes to me so I have been running into a lot of instances where my tests fail because a repository item no longer exists or has been moved or has had the attribute that I'm checking changed.
What I have started to do is make a 'checker' test that simply goes through and checks the info.Exists() status on each repository item with the idea that this could be run once a week and remediation would be more manageable.
I'm currently having to do these checks in a brute force manner of checking each repository item in an if/else block. What I would like to be able to do is write a generic method that has a repository item as a parameter to be passed into it and that method would then check the ..Info.Exists() state. So, what I would like to do is have something like
Code: Select all
public bool Check_RepoItem(RepositoryItem current)
{
if (current.Exists())
{
return true;
}
else
{
return false;
}
}
erik