Nop.Services.Tests.ExportManagerTests.Can_export_orders_xlsx() Failed in Version 3.3

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 9 ans
Hi There,

  I ran the test for Nop.Services.Tests.ExportManagerTests.Can_export_orders_xlsx(). It returned the following failure notification.

Any ideas how we can resolve this matter.

Nop.Services.Tests.ExportImport.ExportManagerTests.Can_export_orders_xlsx:
SetUp : Autofac.Core.Registration.ComponentNotRegisteredException : The requested service 'Nop.Services.Common.IGenericAttributeService' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.


Thanks,
Vikash
Il y a 9 ans
Hi Vikash,

But this method is commented (not implemented) out of the box if you have a look at \Tests\Nop.Services.Tests\ExportImport\ExportManagerTests.cs. It should not work
Il y a 9 ans
Hi Andrei,

Thanks for your help.

I created an export method in Nop.Services.ExportManager for some data.
  
I setup my test similar to ..Text...Can_export_orders_..().

I had to replace the line

    string fileName = Path.GetTempFileName();
    
    with
    string fileName = string.Format("shipping_by_postcode-{0}-{1}.xls",DateTime.Now.ToString("dd-MM-yyyy-hh-mm-ss"), new System.Random().Next() );
            string filePath = Path.GetTempPath() + "\\" +fileName;

   It's all good now.

Cheers,
Vikash
Il y a 6 ans
Hello everyone. We added some tests for exports functions. Please see this commit for more details
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.