80 lines
1.7 KiB
C#
80 lines
1.7 KiB
C#
using Autofac;
|
|
using Autofac.Integration.WebApi;
|
|
using Autofac.Integration.WebApi;
|
|
using KJD_Web;
|
|
using KJD_Web;
|
|
using KJD_Web.Services.Shops;
|
|
using KJD_Web.Services.Users;
|
|
using Newtonsoft.Json;
|
|
using Store.Framework.DependencyInjection;
|
|
using Store.Framework.DependencyInjection;
|
|
using System;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Timers;
|
|
using System.Web.Http;
|
|
|
|
|
|
namespace WebServiceTest;
|
|
|
|
internal class ShopTest
|
|
{
|
|
private static NUnitDebugListener? _listener;
|
|
private IContainer _container;
|
|
[SetUp]
|
|
public void Setup()
|
|
{
|
|
_listener = new NUnitDebugListener();
|
|
Debug.Listeners.Add(_listener);
|
|
var config = new HttpConfiguration();
|
|
_container = ContainerConfig.BuildContainer();
|
|
config.DependencyResolver = new AutofacWebApiDependencyResolver(_container);
|
|
WebApiConfig.Register(config);
|
|
}
|
|
[TearDown]
|
|
public void TearDown()
|
|
{
|
|
_container?.Dispose();
|
|
_listener.Dispose();
|
|
}
|
|
|
|
[Test]
|
|
public void TestAm()
|
|
{
|
|
List<long> ShopIds = new List<long>
|
|
{
|
|
1960967267443631281,
|
|
1960967267443631212,
|
|
1960967267443631213,
|
|
1960967267443631215,
|
|
1960967267443631216,
|
|
1960967267443631218,
|
|
1960967267443631219,
|
|
1960967267443631221,
|
|
1960967267443631222,
|
|
1960967267443631223,
|
|
1960967267443631224,
|
|
1960967267443631226,
|
|
1960967267443631227,
|
|
1960967267443631228,
|
|
1960967267443630057,
|
|
1960967267443629984,
|
|
1960967267443629858,
|
|
1960967267443629855,
|
|
1960967267443629809,
|
|
1960967267443629737,
|
|
1960967267443627649,
|
|
1960967267443627648
|
|
};
|
|
|
|
|
|
var shopService = _container.Resolve<ShopRevenueStatisticsService>();
|
|
shopService.GetShopOrderAmountRange(ShopIds, DateTime.Now.AddMonths(-1), DateTime.Now);
|
|
}
|
|
}
|