using Microsoft.VisualStudio.TestTools.UnitTesting; using XYY.Service.Standard.Order; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using XYY.TaskTrack.Standard; namespace XYY.Service.Standard.Order.Tests { [TestClass()] public class CancelOrderJobSubscribeTests { ICancelOrderJobSubscribe _consumer = null; public CancelOrderJobSubscribeTests() { var services = new ServiceCollection(); services.AddTransient(); services.AddTransient(); var serviceProvider = services.BuildServiceProvider(); _consumer = serviceProvider.GetService(); } [TestMethod()] public void ConsumeTest() { var msg = new CancelOrderJobMessage { CreateTime = DateTime.Now, SysmteNos = new List { "XYYEX0020647589YQ" }, UserId = 164, UserName = "admin" }; _consumer.Consume(msg); Assert.Fail(); } } }