Sellorio / JazSharp

Jasmine inspired mocking and unit testing framework for C#.
Apache License 2.0
65 stars 4 forks source link

Fragile test(s) #18

Open lukesdm opened 5 years ago

lukesdm commented 5 years ago

https://github.com/Sellorio/JazSharp/blob/d0f73504188894fae2341dac8e9d7b10109f350b/JazSharp.Tests/JazExpectationExceptionSpec.cs#L20

Test depends on the directory where the code was built.

Edit: some other files that may be affected:

Find all "seamillo", Subfolders, Keep modified files open, Find Results 1, Entire Solution, ""
  C:\...\JazSharp-1.0.0-rc.2\JazSharp\JazSharp.csproj(20):    <DocumentationFile>C:\Users\seamillo\source\repos\JazSharp\JazSharp\bin\Release\netstandard2.0\JazSharp.xml</DocumentationFile>
  C:\...\JazSharp-1.0.0-rc.2\JazSharp.Tests\JazExpectationExceptionSpec.cs(20):                            @"   at JazSharp.Tests.JazExpectationExceptionSpec.<>c.<.ctor>b__0_1() in C:\Users\seamillo\source\repos\JazSharp\JazSharp.Tests\JazExpectationExceptionSpec.cs:line 15");
  C:\...\JazSharp-1.0.0-rc.2\JazSharp.ManualTest\Program.cs(13):            using (var testCollection = TestCollection.FromSources(new[] { @"C:\Users\seamillo\source\repos\JazSharp\JazSharp.Tests\bin\Debug\netcoreapp2.2\JazSharp.Tests.dll" }))
  Matching lines: 3    Matching files: 3    Total files searched: 77

Edit 3: I'm also getting a couple of fails related to the tests that use JazSharp.Tests.NativeLibrary.dll. Using Test Explorer in Visual Studio 2019. It doesn't seem to be able to load the DLL.

Test Name:  Extern methods should call through as configured.
Test FullName:  JazSharp.Tests.ExternSpec.Extern methods should call through as configured.
Test Source:    C:\...\JazSharp-1.0.0-rc.2\JazSharp.Tests\ExternSpec.cs : line 46
Test Outcome:   Failed
Test Duration:  0:00:00.007465

Result StackTrace:  
at JazSharp.Tests.ExternSpec.GetInt()
--- End of stack trace from previous location where exception was thrown ---
   at JazSharp.SpyLogic.Behaviour.CallThroughBehaviour.Execute(BehaviourArgs args) in C:\...\JazSharp-1.0.0-rc.2\JazSharp\SpyLogic\Behaviour\CallThroughBehaviour.cs:line 16
   at JazSharp.SpyLogic.Behaviour.SpyBehaviourBase.Execute(Spy spy, MethodInfo exactMethod, Object instance, Object[] parameters) in C:\...\JazSharp-1.0.0-rc.2\JazSharp\SpyLogic\Behaviour\SpyBehaviourBase.cs:line 22
   at JazSharp.SpyLogic.SpyExecutionHelper.InnerHandleCall(Spy spy, MethodInfo method, Object instance, Object[] parameters) in C:\...\JazSharp-1.0.0-rc.2\JazSharp\SpyLogic\SpyExecutionHelper.cs:line 74
   at JazSharp.SpyLogic.SpyExecutionHelper.HandleCall(Object[] parameters, MethodBase originalMethod) in C:\...\JazSharp-1.0.0-rc.2\JazSharp\SpyLogic\SpyExecutionHelper.cs:line 38
   at JazSharp.SpyLogic.SpyEntryPoints.Func0[TR](MethodBase originalMethod) in C:\...\JazSharp-1.0.0-rc.2\JazSharp\SpyLogic\SpyEntryPoints.cs:line 98
   at JazSharp.Tests.ExternSpec.<>c.<.ctor>b__1_5() in C:\...\JazSharp-1.0.0-rc.2\JazSharp.Tests\ExternSpec.cs:line 48
   at JazSharp.Testing.TestRun.TestExecutionAsync(Test test, Boolean onlyFocused) in C:\...\JazSharp-1.0.0-rc.2\JazSharp\Testing\TestRun.cs:line 155
Result Message: Unable to load DLL 'JazSharp.Tests.NativeLibrary.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Result StandardOutput:  Unable to load DLL 'JazSharp.Tests.NativeLibrary.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Test Name:  Extern methods should call through by default.
Test FullName:  JazSharp.Tests.ExternSpec.Extern methods should call through by default.
Test Source:    C:\...\JazSharp-1.0.0-rc.2\JazSharp.Tests\ExternSpec.cs : line 15
Test Outcome:   Failed
Test Duration:  0:00:00.0210037

Result StackTrace:  
at JazSharp.Tests.ExternSpec.GetInt()
--- End of stack trace from previous location where exception was thrown ---
   at JazSharp.SpyLogic.SpyExecutionHelper.InnerHandleCall(Spy spy, MethodInfo method, Object instance, Object[] parameters) in C:\...\JazSharp-1.0.0-rc.2\JazSharp\SpyLogic\SpyExecutionHelper.cs:line 62
   at JazSharp.SpyLogic.SpyExecutionHelper.HandleCall(Object[] parameters, MethodBase originalMethod) in C:\...\JazSharp-1.0.0-rc.2\JazSharp\SpyLogic\SpyExecutionHelper.cs:line 38
   at JazSharp.SpyLogic.SpyEntryPoints.Func0[TR](MethodBase originalMethod) in C:\...\JazSharp-1.0.0-rc.2\JazSharp\SpyLogic\SpyEntryPoints.cs:line 98
   at JazSharp.Tests.ExternSpec.<>c.<.ctor>b__1_1() in C:\...\JazSharp-1.0.0-rc.2\JazSharp.Tests\ExternSpec.cs:line 16
   at JazSharp.Testing.TestRun.TestExecutionAsync(Test test, Boolean onlyFocused) in C:\...\JazSharp-1.0.0-rc.2\JazSharp\Testing\TestRun.cs:line 155
Result Message: Unable to load DLL 'JazSharp.Tests.NativeLibrary.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Result StandardOutput:  Unable to load DLL 'JazSharp.Tests.NativeLibrary.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

In the Debug output there was also Exception thrown: 'System.BadImageFormatException' in Mono.Cecil.dll

Sellorio commented 5 years ago

Hi @lukesdm,

Thanks for raising these issues. Unfortunately the viability of this project as a whole is currently uncertain due to issue #17. I have tried and failed to figure out the cause of the issue and until it's resolved I'm not planning on doing additional development.

If you are interested in investigating the issue, I would appreciate any help you could provide.

Thanks, Sea