public void AddScopeStore_ThrowsAnExceptionForInvalidStore() { // Arrange var services = new ServiceCollection(); services.AddOptions(); var builder = new OpenIddictBuilder(services); builder.ScopeType = typeof(object); // Act and assert var exception = Assert.Throws <InvalidOperationException>(() => builder.AddScopeStore(typeof(object))); Assert.Equal("The specified type is invalid.", exception.Message); }
public void AddScopeStore_OverridesDefaultManager() { // Arrange var services = new ServiceCollection(); services.AddOptions(); var builder = new OpenIddictBuilder(services); builder.ScopeType = typeof(object); var type = Mock.Of <IOpenIddictScopeStore <object> >().GetType(); // Act builder.AddScopeStore(type); var provider = services.BuildServiceProvider(); var store = provider.GetRequiredService <IOpenIddictScopeStore <object> >(); // Assert Assert.IsType(type, store); }