ComparetheMarket / fettle

An experimental mutation testing tool for C# code :bug::mag:
MIT License
66 stars 10 forks source link

Exceptions when solution file in Fettle config has no folder in it and doesn't start with ".\" #64

Closed sanderrorije closed 5 years ago

sanderrorije commented 5 years ago

My Fettle config file was in the same folder as my solution file 'FettleTest.sln' and the first line in my config file was 'solution: FettleTest.sln'. This causes Path.GetFullPath(directoryName) to throw an ArugmentException because the directoryName was empty. A workaround is to use '.\FettleTest.sln' in the config file. One way to solve this would be to check whether the directory name is empty before calling Path.GetFullPath and if so, to set the directory name to ".". This causes Path.GetFullPath to work normally. Note that when this issue as fixed like this, at least two source locations need to be fixed. Namely Filtering.RelativeDocumentPath and MutationJobList.RunAll (between the 'for' and the 'foreach' statements). I suggest to put this duplicated code in a shared location.

oliwennell commented 5 years ago

After a conversation on gitter, @sanderrorije has kindly offered to work on this