public void DisposeAndLoad() { ServersWithAuthorizationCode.CleanUpForTests(); var server1 = ServersWithAuthorizationCode.Add("server1", "afunnysecret", new Uri("http://example.org/uri1"), new Uri("http://example.org/uri2"), new Uri("http://example.org/uri3"), new List <String>() { "scopedmaskl", "scope2" }); ServersWithAuthorizationCode.Add("server2", "afunnysecret", new Uri("http://example.org/uri4"), new Uri("http://example.org/uri5"), new Uri("http://example.org/uri6")); ServersWithAuthorizationCode.SaveToIsoStore(); ServersWithAuthorizationCode.LoadFromIsoStore(); var server = ServersWithAuthorizationCode.GetServerWithAuthorizationCode(server1.Guid); server.Should().NotBeNull(); server.ClientId.Should().Be("server1"); server.AuthorizationRequestUri.ToString().Should().Be("http://example.org/uri1"); server.AccessTokenRequestUri.ToString().Should().Be("http://example.org/uri2"); server.RedirectionUri.ToString().Should().Be("http://example.org/uri3"); server.Scopes.FirstOrDefault(item => item == "scopedmaskl").Should().NotBeNull(); server.Scopes.FirstOrDefault(item => item == "scope2").Should().NotBeNull(); var serverNull = ServersWithAuthorizationCode.GetServerWithAuthorizationCode(Guid.NewGuid()); serverNull.Should().BeNull(); }