Exemplo n.º 1
0
        public void Constructor3Test()
        {
            ServiceCollection services = GetServicesCollection <DbContext>();

            using (var context = new ChatLeIdentityDbContext())
            {
                var store = new ChatStore(context);
            }
        }
Exemplo n.º 2
0
        static async Task ExecuteTest(Func <ChatStore <string, ChatLeUser, ChatLeIdentityDbContext <string, Message, Attendee, Conversation, NotificationConnection>, Conversation, Attendee, Message, NotificationConnection>, Task> action)
        {
            ServiceCollection services = GetServicesCollection <ChatLeIdentityDbContext <string, Message, Attendee, Conversation, NotificationConnection> >();

            using (var context = new ChatLeIdentityDbContext <string, Message, Attendee, Conversation, NotificationConnection>(services.BuildServiceProvider()))
            {
                var store = new ChatStore <string, ChatLeUser, ChatLeIdentityDbContext <string, Message, Attendee, Conversation, NotificationConnection>, Conversation, Attendee, Message, NotificationConnection>(context);
                await action(store);
            }
        }
Exemplo n.º 3
0
        static async Task ExecuteTest(Func <ChatStore <string, ChatLeUser, ChatLeIdentityDbContext <string, Message, Attendee, Conversation, NotificationConnection>, Conversation, Attendee, Message, NotificationConnection>, Task> action)
        {
            var builder = new DbContextOptionsBuilder();

            builder.UseInMemoryDatabase();

            using (var context = new ChatLeIdentityDbContext <string, Message, Attendee, Conversation, NotificationConnection>(builder.Options))
            {
                var store = new ChatStore <string, ChatLeUser, ChatLeIdentityDbContext <string, Message, Attendee, Conversation, NotificationConnection>, Conversation, Attendee, Message, NotificationConnection>(context);
                await action(store);
            }
        }