You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

55 lines
2.1 KiB

  1. //using System.Threading.Tasks;
  2. //using Cap.Consistency.Infrastructure;
  3. //using Cap.Consistency.Store;
  4. //using Microsoft.AspNetCore.Builder.Internal;
  5. //using Microsoft.AspNetCore.Testing.xunit;
  6. //using Microsoft.EntityFrameworkCore;
  7. //using Microsoft.Extensions.DependencyInjection;
  8. //using Xunit;
  9. //namespace Cap.Consistency.EntityFrameworkCore.Test
  10. //{
  11. // public class DefaultPocoTest : IClassFixture<ScratchDatabaseFixture>
  12. // {
  13. // private readonly ApplicationBuilder _builder;
  14. // public DefaultPocoTest(ScratchDatabaseFixture fixture) {
  15. // var services = new ServiceCollection();
  16. // services
  17. // .AddDbContext<ConsistencyDbContext>(o => o.UseSqlServer(fixture.ConnectionString))
  18. // .AddConsistency()
  19. // .AddEntityFrameworkStores<ConsistencyDbContext>();
  20. // services.AddLogging();
  21. // var provider = services.BuildServiceProvider();
  22. // _builder = new ApplicationBuilder(provider);
  23. // using (var scoped = provider.GetRequiredService<IServiceScopeFactory>().CreateScope())
  24. // using (var db = scoped.ServiceProvider.GetRequiredService<ConsistencyDbContext>()) {
  25. // db.Database.EnsureCreated();
  26. // }
  27. // }
  28. // [ConditionalFact]
  29. // [FrameworkSkipCondition(RuntimeFrameworks.Mono)]
  30. // [OSSkipCondition(OperatingSystems.Linux)]
  31. // [OSSkipCondition(OperatingSystems.MacOSX)]
  32. // public async Task EnsureStartupUsageWorks() {
  33. // var messageStore = _builder.ApplicationServices.GetRequiredService<IConsistencyMessageStore>();
  34. // var messageManager = _builder.ApplicationServices.GetRequiredService<IConsistencyMessageStore >();
  35. // Assert.NotNull(messageStore);
  36. // Assert.NotNull(messageManager);
  37. // var user = new ConsistencyMessage();
  38. // var operateResult = await messageManager.CreateAsync(user);
  39. // Assert.True(operateResult.Succeeded);
  40. // operateResult = await messageManager.DeleteAsync(user);
  41. // Assert.True(operateResult.Succeeded);
  42. // }
  43. // }
  44. //}