Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

System.InvalidOperationException: Sequence contains no matching element #4

Closed
ravensorb opened this issue Oct 21, 2016 · 3 comments
Closed

Comments

@ravensorb
Copy link

Installed product versions

  • Visual Studio: 2015 Enterprise w/Update 3
  • This extension: 1.4.3

Description

System.InvalidOperationException: Sequence contains no matching element

Steps to recreate

Not sure as it seems to happen only on some classes even if the class is almost identical to one that work

Current behavior

---------------------------

---------------------------
System.InvalidOperationException: Sequence contains no matching element

   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)

   at UnitTestBoilerplate.CreateUnitTestBoilerplateViewModel.<GenerateUnitTestContentsFromFileAsync>d__20.MoveNext() in C:\projects\unittestboilerplategenerator\src\CreateUnitTestBoilerplateViewModel.cs:line 258

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at UnitTestBoilerplate.CreateUnitTestBoilerplateViewModel.<GenerateUnitTestFromProjectItemSummaryAsync>d__19.MoveNext() in C:\projects\unittestboilerplategenerator\src\CreateUnitTestBoilerplateViewModel.cs:line 162

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at UnitTestBoilerplate.CreateUnitTestBoilerplateViewModel.<<get_CreateUnitTestCommand>b__18_0>d.MoveNext() in C:\projects\unittestboilerplategenerator\src\CreateUnitTestBoilerplateViewModel.cs:line 118
---------------------------
OK   
---------------------------
@RandomEngy
Copy link
Contributor

Can you post a class that causes this crash?

@RandomEngy
Copy link
Contributor

Ahh I think I figured it out. If you have a simple type like int as a constructor parameter it does that. I can update to be resilient to that.

@RandomEngy
Copy link
Contributor

Fixed in 1.4.5, now leaves "TODO" when there is a constructor parameter with a simple type.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants