protected void when_loading_configuration(Uri configurationUri)
 {
     try
     {
         Entry = DefaultConfigurationManager.Load <T>(configurationUri);
     }catch (Exception error)
     {
         this.Error = error;
     }
 }
Exemplo n.º 2
0
 void TryLoadConfiguration(Uri uri)
 {
     try
     {
         Entry = DefaultConfigurationManager.Load <T>(uri);
     }
     catch (Exception error)
     {
         Error = error;
     }
 }
Exemplo n.º 3
0
        public void roundtrips(string token, string username, string password)
        {
            var confMan = new DefaultConfigurationManager(new InMemoryFileSystem().GetDirectory(@"c:\config").MustExist());
            confMan.Save(new RemoteRepositories
            {
                new RemoteRepository
                {
                    Name = "iron-hills",
                    FetchRepository = new RemoteRepositoryEndpoint { Token = token, Username = username, Password = password }
                }
            });

            confMan.Load<RemoteRepositories>()["iron-hills"]
                .Check(x => x.FetchRepository.Token.ShouldBe(token))
                .Check(x => x.FetchRepository.Username.ShouldBe(username))
                .Check(x => x.FetchRepository.Password.ShouldBe(password));
        }
Exemplo n.º 4
0
        public void roundtrips(string token, string username, string password)
        {
            var confMan = new DefaultConfigurationManager(new InMemoryFileSystem().GetDirectory(@"c:\config").MustExist());

            confMan.Save(new RemoteRepositories
            {
                new RemoteRepository
                {
                    Name            = "iron-hills",
                    FetchRepository = new RemoteRepositoryEndpoint {
                        Token = token, Username = username, Password = password
                    }
                }
            });

            confMan.Load <RemoteRepositories>()["iron-hills"]
            .Check(x => x.FetchRepository.Token.ShouldBe(token))
            .Check(x => x.FetchRepository.Username.ShouldBe(username))
            .Check(x => x.FetchRepository.Password.ShouldBe(password));
        }