bjorkstromm / gazorator

MIT License
31 stars 9 forks source link

NullReference exception while calling from dotnet test #14

Closed pascalberger closed 4 years ago

pascalberger commented 4 years ago

Using Gazorator in an XUnit test case and running from dotnet test leads to a null reference exception:

Message:
    System.NullReferenceException : Object reference not set to an instance of an object.
  Stack Trace:
    <GetMetadataReferences>d__4.MoveNext()
    AppendPrependIterator`1.LoadFromEnumerator()
    AppendPrependN`1.MoveNext()
    ParameterValidationHelpers.AddRangeChecked[T](ArrayBuilder`1 builder, IEnumerable`1 items, String parameterName)
    ParameterValidationHelpers.ToImmutableArrayChecked[T](IEnumerable`1 items, String parameterName)
    ScriptOptions.WithReferences(IEnumerable`1 references)
    RazorContentGeneratorBase.Generate(String csharpScript)
    <ProcessTemplateAsync>d__17.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    ExceptionDispatchInfo.Throw()
    TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    ConfiguredTaskAwaiter.GetResult()
    GenericIssueReportGenerator.InternalCreateReport(IEnumerable`1 issues)
    GenericIssueReportFixture.CreateReport(IEnumerable`1 issues)
    TheInternalCreateReportMethod.Should_Generate_Report_From_Custom_Template()

Similar to #6, but this time while running from dotnet test instead of Visual Studio Test Explorer.