Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

MessageStoreWithGenericsTest.cs 2.1 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //using System;
  2. //using DotNetCore.CAP.Infrastructure;
  3. //using DotNetCore.CAP.Store;
  4. //using DotNetCore.CAP.Test;
  5. //using Microsoft.AspNetCore.Testing;
  6. //using Microsoft.Extensions.DependencyInjection;
  7. //using Xunit;
  8. //namespace DotNetCore.CAP.EntityFrameworkCore.Test
  9. //{
  10. // public class MessageStoreWithGenericsTest : MessageManagerTestBase<MessageWithGenerics, string>, IClassFixture<ScratchDatabaseFixture>
  11. // {
  12. // private readonly ScratchDatabaseFixture _fixture;
  13. // public MessageStoreWithGenericsTest(ScratchDatabaseFixture fixture) {
  14. // _fixture = fixture;
  15. // }
  16. // protected override void AddMessageStore(IServiceCollection services, object context = null) {
  17. // services.AddSingleton<IConsistencyMessageStore>(new MessageStoreWithGenerics((ContextWithGenerics)context));
  18. // }
  19. // protected override object CreateTestContext() {
  20. // return CreateContext();
  21. // }
  22. // public ContextWithGenerics CreateContext() {
  23. // var db = DbUtil.Create<ContextWithGenerics>(_fixture.ConnectionString);
  24. // db.Database.EnsureCreated();
  25. // return db;
  26. // }
  27. // protected override MessageWithGenerics CreateTestMessage(string payload = "") {
  28. // return new MessageWithGenerics() {
  29. // Payload = payload,
  30. // SendTime = DateTime.Now,
  31. // Status = MessageStatus.WaitForSend,
  32. // UpdateTime = DateTime.Now
  33. // };
  34. // }
  35. // protected override bool ShouldSkipDbTests() {
  36. // return TestPlatformHelper.IsMono || !TestPlatformHelper.IsWindows;
  37. // }
  38. // }
  39. // public class MessageWithGenerics : ConsistencyMessage
  40. // {
  41. // }
  42. // public class MessageStoreWithGenerics : ConsistencyMessageStore<ContextWithGenerics>
  43. // {
  44. // public MessageStoreWithGenerics(ContextWithGenerics context) : base(context) {
  45. // }
  46. // }
  47. // public class ContextWithGenerics : ConsistencyDbContext
  48. // {
  49. // public ContextWithGenerics() {
  50. // }
  51. // }
  52. //}