public void AddTokenStore_ThrowsAnExceptionForInvalidStore()
        {
            // Arrange
            var services = new ServiceCollection();

            services.AddOptions();

            var builder = new OpenIddictBuilder(services);

            builder.TokenType = typeof(object);

            // Act and assert
            var exception = Assert.Throws <InvalidOperationException>(() => builder.AddTokenStore(typeof(object)));

            Assert.Equal("The specified type is invalid.", exception.Message);
        }
        public void AddTokenStore_OverridesDefaultManager()
        {
            // Arrange
            var services = new ServiceCollection();

            services.AddOptions();

            var builder = new OpenIddictBuilder(services);

            builder.TokenType = typeof(object);

            var type = Mock.Of <IOpenIddictTokenStore <object> >().GetType();

            // Act
            builder.AddTokenStore(type);

            var provider = services.BuildServiceProvider();
            var store    = provider.GetRequiredService <IOpenIddictTokenStore <object> >();

            // Assert
            Assert.IsType(type, store);
        }