Base solution for your next web application

Activities of "guillaumej"

(I also removed the DependsOn on TotoWebApi in TotoWebAdminModule) ( using 0.97)

Answer

I have exactly the same problem.

In the TestBase Contructor, I create some seed data which is correctly initialized (with a valid TenantId)

But as soon as I am in my unit tests, the data is not found by my Application service (I checked that the current Tenant Id is the right one)

Answer

Going further : So, when I create an entity using Dbcontext, I can't find it by ApplicationService.List (when testing) BUT, if in my unit test, I create another entity using the ApplicationService.Create function, then ApplicationService.list returns both entities !

( Both the list and the Create function are using the basic IRepository implementation)

That's quite weird.

I had the same kind of problem (forgot an IApplicationService so DI was not working), and I think it was not handled by ABP because the error came before ABP error handling was set up.

BTW, in unit tests, the error was clearly visible.

No, I don't have this problem anymore :

  • I moved my second web site to an area in the first website
  • I tried quickly to reproduce my bug and was not able to do it

But as for your questions : I was getting my error in n global.asa/application, so nothing specific was called.

Thanks !

Question

I have exactly this same error : Exception Details: System.InvalidOperationException: Timeouts are not supported on this stream. #1426

My case is an application Service having a stream Parameter System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component) Abp.Runtime.Validation.Interception.MethodInvocationValidator.ValidateObjectRecursively(Object validatingObject) Abp.Runtime.Validation.Interception.MethodInvocationValidator.ValidateMethodParameter(ParameterInfo parameterInfo, Object parameterValue) Abp.Runtime.Validation.Interception.MethodInvocationValidator.Validate() Abp.Runtime.Validation.Interception.ValidationInterceptor.Intercept(IInvocation invocation) Castle.DynamicProxy.AbstractInvocation.Proceed() Castle.Proxies.ProduitServiceProxy.ImportProducts(Stream imports) Lako.Tests.ServicesLako.ProduitsTest.ImportProducts() ProduitsTest.cs: line: 38

as you can see, it's during an unit test on an Application service.

Thanks !

Answer

I solved my problem using [DisableValidation] on my method.

Here is it, but really, you should recreate it AllAbpMigrations.zip

It's an old post, but I'm also discovering that even a very basic test is taking 1 second (on my computer, 5 on visual studio.com)

This is awfully slow for just testing a simple, rounding method (I'm just calling Math.Round, in fact)

There's no call sto ABP, Services, Context, anything, except in the constructor/ initialize.

I think the problem is due to XUnit, since it create a new test class instance for every test methods, all ABP pipeline/init must be started anew, so, it's too slow.

I'm going to rewrite my tests using MS Test, using LocalDb (1) to create a test DB, and using transactions to keep it clean

(1) Effort is supposed to be faster, but I have two problems with it :

  • it does not support Database.SqlQuery
  • I can't not check the SQL generated by Linq when I'm using it.

I want to use my own PasswordHasher, but this line:

var verificationResult = new PasswordHasher().VerifyHashedPassword(user.Password, plainPassword);

is always creating and using the default identity hasher

Is there any reason you can't use UserManager.PasswordHasher?

(it would be nice also if we could overload loginasync withotu having to rewrite everything in ABPUserManager, but I'm not sure I could be done without exposing too much)

Showing 21 to 30 of 30 entries