CancelOrderJobSubscribeTests.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using XYY.Service.Standard.Order;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using Microsoft.Extensions.DependencyInjection;
  9. using XYY.TaskTrack.Standard;
  10. namespace XYY.Service.Standard.Order.Tests
  11. {
  12. [TestClass()]
  13. public class CancelOrderJobSubscribeTests
  14. {
  15. ICancelOrderJobSubscribe _consumer = null;
  16. public CancelOrderJobSubscribeTests()
  17. {
  18. var services = new ServiceCollection();
  19. services.AddTransient<ICancelOrderJobSubscribe, CancelOrderJobSubscribe>();
  20. services.AddTransient<IMQManager, MQManager>();
  21. var serviceProvider = services.BuildServiceProvider();
  22. _consumer = serviceProvider.GetService<ICancelOrderJobSubscribe>();
  23. }
  24. [TestMethod()]
  25. public void ConsumeTest()
  26. {
  27. var msg = new CancelOrderJobMessage
  28. {
  29. CreateTime = DateTime.Now,
  30. SysmteNos = new List<string> { "XYYEX0020647589YQ" },
  31. UserId = 164,
  32. UserName = "admin"
  33. };
  34. _consumer.Consume(msg);
  35. Assert.Fail();
  36. }
  37. }
  38. }