ChristopherHaws / gdax-dotnet

DotNet Core GDAX Exchange API
MIT License
7 stars 7 forks source link

failing test - GetOrders_ShouldAllowOlderAndNewerPage #7

Open bdelaney opened 6 years ago

bdelaney commented 6 years ago

Have set up sandbox correctly and modified secrets. All tests pass except one. I do have orders in the sandbox account. Noob dev here so troubleshooting tests is challenging. Output of failing test:

Test Name:  Gdax.Tests.Orders.GetOrdersQueryTests.GetOrders_ShouldAllowOlderAndNewerPage
Test FullName:  Gdax.Tests.Orders.GetOrdersQueryTests.GetOrders_ShouldAllowOlderAndNewerPage (88cce4e0ae8de4f259a987a892197b44a7dffbd8)
Test Source:    C:\Users\delan\Documents\GitHub\gdax-dotnet\Gdax.Tests\Orders\GetOrdersQueryTests.cs : line 26
Test Outcome:   Failed
Test Duration:  0:00:00.783

Result StackTrace:  
at Gdax.PagedResults2.PreviousPage() in C:\Users\delan\Documents\GitHub\gdax-dotnet\Gdax\Paging\PagedResults.cs:line 30
   at Gdax.Tests.Orders.GetOrdersQueryTests.<GetOrders_ShouldAllowOlderAndNewerPage>d__1.MoveNext() in C:\Users\delan\Documents\GitHub\gdax-dotnet\Gdax.Tests\Orders\GetOrdersQueryTests.cs:line 39
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Result Message: Gdax.GdaxException : Cannot determine before page.
bdelaney commented 6 years ago

Addendum: silly question, but why is the test project .NET Core 2.0 and the main library is .NET Standard 1.3? Should the main library be updated to use .NET Standard 2.0? I removed some of the older .NET Core SDKs and cannot build anymore. No doubt my ignorance of how the dotnet versions must align in order for this project to load & build successfully. ... Ahh, there is a problem in VS 2017 with IDE being 32 bit and not showing the 64 bit .NET Core choices. Once I install the 32bit versions of .NET Core SDKs, I can build again. Also, noted that the solution global.json file needs to be updated to reflect installed SDK version on my machine. Was showing preview version. This is a reported problem in VS 2017: https://developercommunity.visualstudio.com/content/problem/117062/net-core-20-not-showing-in-new-project-selection.html#reply-form

bdelaney commented 6 years ago

Ran the failing test in debug mode and see it failing at line mentioned in stack trace above. Wonder if maybe I just need to have enough sandbox orders to actually have more than one page. (will try and create more orders and run test again.... Put in over 40, no luck) Fails with NextPage call below. var ordersPage2 = await client.GetOrders(paging: orders.NextPage());

markwkjr commented 5 years ago

I had this issue until I manually put in Orders, but you're saying you put in 40...

Can you debug the test and see if orders from the following line is getting any values? var orders = await client.GetOrders(states: OrderStates.All, paging: new PagingOptions<DateTime?>